A secure API for storing and managing encrypted secrets built with Rust ideal for security-critical applications where performance and correctness are essential.
This project provides an API for storing encrypted data securely. It leverages modern Rust libraries to create a high-performance, type-safe application with strong security guarantees.
- Secure Storage: All secrets are stored encrypted
- UUID-Based Access: Secrets are accessed via UUIDs
- Serializable Models: API responses are cleanly structured using serialization
- RESTful API: Simple and intuitive RESTful endpoints (encrypt/decrypt)
The project is built with the following technologies:
- Loco.rs: Modern Rust framework for building applications
- SeaORM: Async ORM for Rust
- AES256 Encryption: Industry-standard encryption for data security
secrets/
├── src/
│ ├── models/
│ │ └── secrets.rs # Data models and serialization
│ ├── cryptography/
│ │ └── encryption.rs # Encryption/decryption logic
│ ├── routes.rs # API endpoints
│ └── main.rs # Application entry point
└── ...
Endpoint | Method | Description |
---|---|---|
/secrets/decrypt/:uid |
POST | Retrieve a secret by UUID |
/secrets/encrypt |
POST | Create a new secret |
- Rust 1.70+
- (Optional) PostgreSQL or other supported database
-
Clone this repository and:
cd secrets
-
Build the project:
cargo build --release
-
Run the server:
curl -X POST http://localhost:5150/secrets \
-H "Content-Type: application/json" \
-d '{"data": "your-secret-data", "passphrase": "your-secure-passphrase"}'
curl http://localhost:5150/secrets/123e4567-e89b-12d3-a456-426614174000
# Add a GitHub remote
git remote add origin https://github.com/yourusername/secrets.git
# Verify remotes
git remote -v
# Push to remote
git push -u origin main
cargo test
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.