A simple Streamlit app to generate Fernet keys and encrypt/decrypt files (including zipped files) in your browser.
- Generate Key — create a new, strong Fernet key and download it as
fernet.key - Encrypt — upload any file (zip or otherwise) + a Fernet key → download the encrypted
.encfile - Decrypt — upload an encrypted file + the matching Fernet key → download the restored original file
All processing happens in memory for the session; nothing is written to disk on the server.
- Setup
poetry install- Run
streamlit run fernet_file_app.pyThen open the local URL Streamlit prints (usually http://localhost:8501).
- Go to Generate Key, click Generate new key, and save the key somewhere safe (password manager or secrets vault). Anyone with this key can decrypt your files — if you lose it, encrypted files can't be recovered.
- Go to Encrypt, upload a file, paste the key, click Encrypt file, then download the
.encoutput. - Go to Decrypt, upload the
.encfile, paste the same key, click Decrypt file, then download the restored file.
- The key must be a valid Fernet key (32 url-safe base64-encoded bytes) — the app validates this before letting you proceed.
- Best suited for typical file sizes; very large files (multi-GB) are encrypted fully in memory, so performance may degrade at that scale.
- The encrypted file can be safely pushed to Git or share anywhere, so long the Fernet key for it is saved secretly.# file-crypt