A secure API for storing username and password pairs for websites. All credentials are encrypted at rest using AES-256. The master password is used to derive the encryption key, ensuring only the owner can decrypt their data. The API supports basic CRUD operations and search functionality.
- AES-256 encryption for all stored credentials
- Key derivation from master password
- Envelope encryption pattern for secure storage
- CRUD operations: Create, Read, Update, Delete
- Search functionality for credentials
- User authentication with JWT
- PostgreSQL database with GORM ORM
- Built with Gin web framework
- Gin (Go web framework)
- PostgreSQL
- GORM (ORM for Go)
- Go crypto/aes package
POST /register— Register a new userPOST /login— Authenticate user and return tokenPOST /vault— Add a new credential (encrypted)GET /vault— List all credentialsGET /vault/search?q=site— Search credentials by sitePUT /vault/:id— Update a credentialDELETE /vault/:id— Delete a credential
- All credentials encrypted with AES-256
- Encryption key derived from master password (PBKDF2 or similar)
- Envelope encryption for secure key management
- Only the owner can decrypt their credentials
- Clone the repository
- Install dependencies:
go mod tidy
- Set up PostgreSQL and configure environment variables
- Run the server:
go run cmd/server/main.go
- Use the API via Postman or curl
DB_HOSTDB_PORTDB_USERDB_PASSWORDDB_NAMEJWT_SECRET
- AES-256, or Advanced Encryption Standard with a 256-bit key, is one of the most secure encryption algorithms available today. It is a symmetric key encryption standard adopted by the U.S. government and widely used across various industries for securing sensitive data. The strength of AES-256 lies in its large key size, which makes brute-force attacks virtually impractical. With its robust security features and efficiency, AES-256 is the go-to choice for protecting data in transit and at rest.
- Data-at-Rest Encryption ( organizations can use AES-256 to encrypt sensitive data to protect it from unauthorized access, even if the storage medium is compromised)
- Secure Communication ( it is widely used in vpns and tls/ssl)
- Password Management
- File Encryption
See the TODO.md file for a step-by-step breakdown of tasks.
MIT License