SecureDiary is a simple command-line tool to securely create and retrieve encrypted text entries (like diary entries). Each entry is AES-GCM encrypted using a password and saved as a .json file, ensuring confidentiality and integrity.
- Create password-protected encrypted text entries
- Optionally import from
.txtfiles - Retrieve and decrypt entries interactively
- Secure AES-GCM encryption using a key derived from your password (PBKDF2)
- Simple config file to set a persistent save directory
- Clone this repository or copy
enc.pyand place it in your project directory. - Install the required Python package:
pip install cryptography
or
pip install -r requirements.txt- Create a config file in the same directory named
.tool_config.jsonwith the following content:
{
"entries_dir": ""
}This will be updated automatically when you set the save directory.
python3 enc.py --savedir /path/to/your/entriesThis updates the save path in .tool_config.json.
python3 enc.py --make_entryYou will be prompted to enter:
- A password
- The content of your entry
- A filename (or press enter to use timestamp)
python3 enc.py --make_entry --file your_text_file.txtpython3 enc.py --get_entryThis will:
- List all saved entries
- Prompt you to select one
- Ask for the password
- Decrypt and display the entry
enc.py: Main CLI script.tool_config.json: Stores the directory path to save encrypted entriesyour_entries/: Directory where encrypted.jsonfiles are stored
Each entry file contains:
{
"salt": "...",
"nonce": "...",
"ciphertext": "...",
"tag": "..."
}- Encryption is done using AES-GCM with 256-bit key.
- Keys are derived using PBKDF2 with SHA-256 and 480,000 iterations.
- If you forget the password for an entry, it cannot be recovered.
- Keep
.tool_config.jsonand your entries directory safe and secure.
- Python 3.7+
cryptographypackage
MIT License — feel free to use, modify, and distribute.