A secure Rust-based encrypted notes application that allows users to create self-destructing notes. Once a note is read, it is deleted permanently from storage. Built using Warp (Web API) and CLI (Command Line Interface).
✅ AES-256-GCM Encryption - All notes are securely encrypted before storage.
✅ One-Time Read (Self-Destructing Notes) - Once a note is read, it is permanently deleted.
✅ CLI & API Support - Use it via command line or integrate it into web applications.
✅ Rust-powered Security - Built using Rust’s strong type safety and performance benefits.
✅ Local-Only Storage - Messages are currently stored only on the same machine.
Currently, this app only works on the same machine. This means:
- The API is not exposed to the internet (
127.0.0.1:3030
is only accessible locally). - Notes cannot be shared with someone on another device or location.
- All stored messages exist only on your local system.
🔹 To make it work globally, you would need to:
- Deploy the API online (e.g., AWS, DigitalOcean, Railway.app).
- Use a remote database instead of local storage (
db/
folder). - Expose a real URL so anyone can create & read notes remotely.
📌 This version is great for personal use or local secure notes! 🔒
git clone https://github.com/YOUR-USERNAME/encrypted-notes.git
cd encrypted-notes
cargo build
cargo run
cargo run -- create "Your secret message!"
For better security, replace the hardcoded encryption key inside main.rs
.
Use OpenSSL or any secure method to generate a random key:
openssl rand -base64 32
Replace the existing key in main.rs
:
let key: [u8; 32] = *b"this_is_a_strong_32_byte_key12!!"; // 🔴 Replace this!
With:
let key: [u8; 32] = *b"your_new_random_32_byte_key_here";
📌 Do not hardcode your key in production. Store it securely using environment variables or a secrets manager.
cargo run -- create "This is a secret note!"
✅ Output:
Note created! Access it using:
http://127.0.0.1:3030/read/<note_id>
cargo run -- read <note_id>
✅ Expected Output:
Note: This is a secret note!
cargo run -- read <same_note_id>
🚨 Expected Output:
❌ This note has already been read and is now deleted!
This project is licensed under the MIT License - feel free to use and modify it as needed.