Skip to content

fix: AEAD stream finalization, secure wipe, and password confirmation#4

Open
vylarion wants to merge 1 commit into
warchs:mainfrom
vylarion:main
Open

fix: AEAD stream finalization, secure wipe, and password confirmation#4
vylarion wants to merge 1 commit into
warchs:mainfrom
vylarion:main

Conversation

@vylarion
Copy link
Copy Markdown

@vylarion vylarion commented Apr 3, 2026

  1. Fix AEAD stream finalization (security) The encrypted stream never called encrypt_last/decrypt_last, only encrypt_next/decrypt_next. This meant the stream was never cryptographically sealed — an attacker could silently truncate the ciphertext without detection.

EncryptedWriter now calls encrypt_last() for the final chunk via an explicit finalize() method. DecryptedReader uses a lookahead pattern to detect the final encrypted chunk and decrypt it with decrypt_last().

  1. Implement real secure wipe (security) The --wipe flag used fs::remove_file() which only unlinks the file — data remains on disk and is forensically recoverable. Now overwrites file contents with cryptographically random data and calls sync_all() before unlinking. Directories are recursively wiped file-by-file.

  2. Add password confirmation on pack (UX) pack now prompts for password confirmation to prevent typos that would make data irrecoverable, which is especially critical when combined with --wipe.

2. Secure Wipe
3. Password Confirmation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant