Unauffaelliger Default-Dateiname mit Zeitstempel statt harmlos.png

Web-App vergibt beim Senden einen Screenshot-artigen Namen
(Screenshot_YYYYMMDD_HHMMSS.png) statt des verraeterischen harmlos.png.
Screenshot-Stil passt zum PNG-Format (echte Kamerafotos sind JPG).
Umstellbar ueber CARRIER_PREFIX. README-Beispiele nachgezogen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 22:08:22 +00:00
parent 30127db247
commit 685a72ab89
2 changed files with 12 additions and 3 deletions

View File

@@ -75,7 +75,7 @@ python3 schattenpost.py hide \
-t "Treffpunkt morgen 18 Uhr." \ -t "Treffpunkt morgen 18 Uhr." \
-k kontakt_bob_meine_seite/send.key \ -k kontakt_bob_meine_seite/send.key \
-c urlaubsfoto.jpg \ -c urlaubsfoto.jpg \
-o harmlos.png -o Screenshot_20260714_220801.png
``` ```
Der Sende-Offset im `send.key` wird dabei automatisch fortgeschrieben. Der Sende-Offset im `send.key` wird dabei automatisch fortgeschrieben.
@@ -84,7 +84,7 @@ Alternativ `-i datei` statt `-t`, oder Text über stdin.
### 3. Empfangen ### 3. Empfangen
```bash ```bash
python3 schattenpost.py reveal -s harmlos.png -k kontakt_bob_meine_seite/recv.key python3 schattenpost.py reveal -s Screenshot_20260714_220801.png -k kontakt_bob_meine_seite/recv.key
``` ```
Mit `-o klartext.txt` in eine Datei statt auf stdout. Mit `-o klartext.txt` in eine Datei statt auf stdout.

View File

@@ -237,6 +237,15 @@ if (typeof document !== 'undefined') (function () {
const show = (el, kind, text) => { el.className = 'msg show ' + kind; el.textContent = text; }; const show = (el, kind, text) => { el.className = 'msg show ' + kind; el.textContent = text; };
const blobUrl = (bytes, mime) => URL.createObjectURL(new Blob([bytes], { type: mime || 'application/octet-stream' })); const blobUrl = (bytes, mime) => URL.createObjectURL(new Blob([bytes], { type: mime || 'application/octet-stream' }));
// Unauffälliger Dateiname mit aktuellem Zeitstempel (Screenshot-Stil passt zu PNG).
// Für Kamera-Look: PREFIX auf 'IMG' setzen. Format: <PREFIX>_YYYYMMDD_HHMMSS.png
const CARRIER_PREFIX = 'Screenshot';
function carrierName() {
const d = new Date(), p = (n) => String(n).padStart(2, '0');
return `${CARRIER_PREFIX}_${d.getFullYear()}${p(d.getMonth()+1)}${p(d.getDate())}`
+ `_${p(d.getHours())}${p(d.getMinutes())}${p(d.getSeconds())}.png`;
}
document.querySelectorAll('.tabs button').forEach((btn) => { document.querySelectorAll('.tabs button').forEach((btn) => {
btn.onclick = () => { btn.onclick = () => {
document.querySelectorAll('.tabs button').forEach((b) => b.classList.remove('active')); document.querySelectorAll('.tabs button').forEach((b) => b.classList.remove('active'));
@@ -291,7 +300,7 @@ if (typeof document !== 'undefined') (function () {
cv.toBlob((blob) => { cv.toBlob((blob) => {
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
$('s-preview').src = url; $('s-preview').style.display = 'block'; $('s-preview').src = url; $('s-preview').style.display = 'block';
const dl = $('s-dlimg'); dl.href = url; dl.style.display = 'block'; const dl = $('s-dlimg'); dl.href = url; dl.download = carrierName(); dl.style.display = 'block';
// Aktualisierter Sendeschlüssel (Offset fortgeschrieben) // Aktualisierter Sendeschlüssel (Offset fortgeschrieben)
const nextOff = key.sendOffset + plain.length; const nextOff = key.sendOffset + plain.length;
const newKey = SP.buildKey(SP.ROLE_SEND, key.streamId, nextOff, key.material); const newKey = SP.buildKey(SP.ROLE_SEND, key.streamId, nextOff, key.material);