This project is a secure pastebin-like application designed to allow users to create, manage, and access encrypted pastes. It provides user authentication, secure paste storage, and click tracking, with data managed across multiple services including AWS S3, Redis, and PostgreSQL.
Features
- Register and log in using a username and password.
- JWT token-based authentication for secure API access.
- Users can create pastes with metadata including title, content, tags, visibility (public/private), expiration time, and security settings.
- Unique ID generation for each paste using nanoid, validated for uniqueness with a Bloom filter.
- Content encryption with AES-256-CBC algorithm, and CRC32 checksum for integrity verification.
- Validation to ensure content size does not exceed 1MB.
- Paste content is stored securely in Amazon S3.
- Private pastes require authentication; access is controlled based on user permissions.
- Cached content retrieval from Redis to improve performance and reduce S3 calls.
- Metadata and content retrieval using signed URLs from S3 when not cached.
- Paste expiration and visibility checks, password protection, and data integrity verification.
- Secure pastes are decrypted upon retrieval if necessary.
- Increment click counts in Redis, and periodically update PostgreSQL with batch processing.