An educational project demonstrating cloud storage encryption patterns
π Quick Start β’ π Documentation β’ π§ Configuration β’ π‘οΈ Security
Cloud Cryptography Lab is an educational web application designed for Computer Science students and security enthusiasts. It provides hands-on experience with two fundamental patterns of cloud storage security using AWS S3 and Go:
- π Server-Side Encryption (SSE-KMS) - AWS-managed encryption
- π‘οΈ Client-Side Encryption (CSE-AES-GCM) - Application-controlled encryption
The application features a modern, dark-themed web interface that visualizes cryptographic concepts and allows you to experiment with different encryption strategies in a real cloud environment.
|
|
- Visual feedback showing plaintext vs ciphertext
- Object browser with
sse/andcse/prefixes - Real-time encryption status indicators
- Modern dark theme optimized for developers
- Go 1.23+ installed (Download here)
- AWS Account with S3 and KMS access
- AWS Credentials configured locally
```bash
git clone https://github.com/yourusername/cloud-cryptography-lab.git cd cloud-cryptography-lab
go mod tidy
cp .env.example .env
go run .
open http://localhost:8080 ```
Create a .env file in the root directory:
```bash
AWS_REGION=us-east-1 S3_BUCKET=your-unique-bucket-name AWS_ACCESS_KEY_ID=your_access_key_here AWS_SECRET_ACCESS_KEY=your_secret_key_here
SSE_KMS_KEY_ID=arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
CUSTOMER_KEY_BASE64=YourGeneratedBase64KeyHere==
PORT=8080 ```
β οΈ Security Note: Never commit your.envfile to version control!
``` π Plaintext File β π HTTPS Upload β βοΈ AWS S3 β π KMS Encryption β πΎ Encrypted Storage ```
- Upload: File sent as plaintext over HTTPS
- Storage: S3 encrypts using your KMS key
- Download: S3 auto-decrypts if you have permissions
``` π Plaintext File β π AES-GCM Encrypt β π Ciphertext Upload β βοΈ AWS S3 β πΎ Ciphertext Storage ```
- Encrypt: AES-256-GCM encryption locally
- Upload: Only ciphertext sent to S3
- Download: Decrypt locally with customer key
| This is an educational project | |
|---|---|
| π Purpose | Demonstration and learning only |
| π Key Management | Use proper vaults in production (AWS Secrets Manager, HashiCorp Vault) |
| π Key Rotation | Implement rotation strategies for production |
| π€ IAM Permissions | Use least-privilege access |
```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:PutObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::your-bucket-name", "arn:aws:s3:::your-bucket-name/*" ] }, { "Effect": "Allow", "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "arn:aws:kms:region:account:key/key-id" } ] } ```
```
cloud-cryptography-lab/
βββ π main.go # Application entry point & config loading
βββ π handlers.go # HTTP handlers (Upload, List, Download)
βββ βοΈ s3.go # AWS S3 SDK integration & utilities
βββ π crypto.go # AES-GCM encryption/decryption logic
βββ π templates/
β βββ π¨ index.html # Modern web interface (HTML/CSS)
βββ π§ go.mod # Go module dependencies
βββ π .gitignore # Git ignore rules
βββ π .env.example # Environment template
βββ π README.md # This documentation
```
| Component | Technology | Purpose |
|---|---|---|
| Backend | Core application logic | |
| Cloud | Storage & key management | |
| Crypto | Client-side encryption | |
| Frontend | Modern dark UI | |
| Config | Environment management |
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for Computer Science Education
β Star this repo if it helped you learn about cloud cryptography! β