{"id":28566343,"url":"https://github.com/abdorrahmani/cryptolens","last_synced_at":"2026-03-08T05:32:04.518Z","repository":{"id":295372474,"uuid":"989912932","full_name":"abdorrahmani/CryptoLens","owner":"abdorrahmani","description":"CryptoLens is an educational CLI tool designed to help users understand various encryption methods and their underlying principles. It provides step-by-step visual explanations of different encryption algorithms and their processes, making cryptography concepts more accessible and easier to understand.","archived":false,"fork":false,"pushed_at":"2025-07-27T08:17:42.000Z","size":1703,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-27T10:06:13.262Z","etag":null,"topics":["aes-encryption","anophel","base64","caesar-cipher","cryptography","cryptolens","go","golang","hmac","jwt","jwt-decode","pbkdf","rsa","sha256-hash"],"latest_commit_sha":null,"homepage":"https://anophel.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdorrahmani.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-25T05:17:01.000Z","updated_at":"2025-07-27T08:17:11.000Z","dependencies_parsed_at":"2025-07-17T21:34:46.929Z","dependency_job_id":"17190c3e-d649-4d94-b2ff-e80696dd5187","html_url":"https://github.com/abdorrahmani/CryptoLens","commit_stats":null,"previous_names":["abdorrahmani/cryptolens"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/abdorrahmani/CryptoLens","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FCryptoLens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FCryptoLens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FCryptoLens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FCryptoLens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdorrahmani","download_url":"https://codeload.github.com/abdorrahmani/CryptoLens/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdorrahmani%2FCryptoLens/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30246724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes-encryption","anophel","base64","caesar-cipher","cryptography","cryptolens","go","golang","hmac","jwt","jwt-decode","pbkdf","rsa","sha256-hash"],"created_at":"2025-06-10T15:09:55.849Z","updated_at":"2026-03-08T05:32:04.495Z","avatar_url":"https://github.com/abdorrahmani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CryptoLens 🔐\n\n[![Go Version](https://img.shields.io/badge/Go-1.21+-00ADD8?style=flat\u0026logo=go)](https://golang.org)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/abdorrahmani/cryptolens)](https://goreportcard.com/report/github.com/abdorrahmani/cryptolens)\n[![GoDoc](https://godoc.org/github.com/abdorrahmani/cryptolens?status.svg)](https://godoc.org/github.com/abdorrahmani/cryptolens)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n[![Release](https://img.shields.io/github/v/release/abdorrahmani/cryptolens?include_prereleases\u0026sort=semver)](https://github.com/abdorrahmani/cryptolens/releases)\n[![Security](https://img.shields.io/badge/Security-Audited-brightgreen.svg)](SECURITY.md)\n[![Tests](https://img.shields.io/badge/Tests-Passing-brightgreen.svg)](https://github.com/abdorrahmani/cryptolens/actions)\n[![Coverage](https://img.shields.io/badge/Coverage-90%25-brightgreen.svg)](https://codecov.io/gh/abdorrahmani/cryptolens)\n[![Platform](https://img.shields.io/badge/Platform-Windows%20%7C%20Linux%20%7C%20macOS-blue.svg)](https://github.com/abdorrahmani/cryptolens/releases)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/CryptoLens.png\" alt=\"CryptoLens Logo\" width=\"250\"/\u003e\n  \u003cbr/\u003e\n  \u003cem\u003eYour Interactive Cryptography Learning Tool\u003c/em\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/cmd.png\" alt=\"CryptoLens Command Line Interface\" width=\"600\"/\u003e\n  \u003cbr/\u003e\n  \u003cem\u003eInteractive Command Line Interface\u003c/em\u003e\n\u003c/div\u003e\n\n## 📖 Overview\nCryptoLens is an educational CLI tool designed to help users understand various encryption methods and their underlying principles. It provides step-by-step visual explanations of different encryption algorithms and their processes, making cryptography concepts more accessible and easier to understand.\n\n## 🌟 Highlights\n\n- 🎓 **Educational Focus**: Perfect for learning cryptography concepts\n- 🔐 **Multiple Algorithms**: Support for various encryption methods\n- 📊 **Visual Learning**: Step-by-step process visualization\n- 🔒 **Security First**: Best practices and security considerations\n- 🚀 **Modern Features**: Latest cryptographic standards\n- 🎨 **Beautiful UI**: Colored output and ASCII art\n- 📱 **Cross-Platform**: Works on Windows, Linux, and macOS\n- 🔄 **Active Development**: Regular updates and improvements\n\n## 🏆 Features in Numbers\n\n- 10+ Encryption Methods\n- 6 HMAC Algorithms\n- 3 PBKDF Implementations\n- 2 Key Exchange Protocols\n- 3 JWT Algorithms\n- 90%+ Test Coverage\n- 100% Security Audited\n- 24/7 Community Support\n\n# 📚 Supported Algorithms\n\nEach algorithm below is fully documented in the [`/docs`](./docs) folder. See the linked docs for in-depth technical details, security notes, and troubleshooting.\n\n## ✨ Features\n\n### 🔄 Multiple Encryption Methods\n- **Base64 Encoding**\n  - Binary-to-text encoding\n  - Step-by-step visualization of the encoding process\n  - ASCII and binary representations\n  - Support for both encoding and decoding operations\n\n- **Caesar Cipher**\n  - Classical substitution cipher\n  - Character-by-character transformation\n  - Alphabet shift visualization\n  - Customizable shift value\n  - Support for both encryption and decryption\n\n- **AES Encryption**\n  - Modern symmetric encryption (AES-256)\n  - Block cipher operations\n  - Secure key and IV handling\n  - Support for both encryption and decryption\n  - Automatic key generation\n\n- **ChaCha20-Poly1305**\n  - Modern stream cipher with AEAD\n  - High-performance encryption\n  - Authentication and encryption in one operation\n  - Support for both encryption and decryption\n  - Secure nonce handling\n\n- **SHA-256 Hashing**\n  - Cryptographic hash function\n  - One-way transformation\n  - Hash value generation\n  - Input validation and error handling\n\n- **RSA Encryption**\n  - Asymmetric encryption (RSA-2048)\n  - Public/private key pair generation\n  - Secure key storage in project directory\n  - Support for both encryption and decryption\n  - Automatic key pair management\n  - Base64 encoded output for encrypted data\n\n- **HMAC Authentication**\n  - Hash-based Message Authentication Code\n  - Multiple hash algorithm support:\n    - SHA-1 (legacy, not recommended)\n    - SHA-256 (widely used)\n    - SHA-512 (higher security margin)\n    - BLAKE2b-256 (faster alternative)\n    - BLAKE2b-512 (high performance)\n    - BLAKE3 (latest generation)\n  - Real-time performance measurements\n  - Detailed algorithm information\n  - Step-by-step HMAC process visualization\n  - Secure key management\n  - Output in both Hex and Base64 formats\n  - Built-in benchmarking tool:\n    - Compare performance of all HMAC algorithms\n    - Customizable number of iterations\n    - Sample text input\n    - Performance recommendations\n    - Detailed timing statistics\n    - Percentage-based performance comparison\n    - Interactive loading animation\n    - Colored ASCII art visualization\n    - Proportional scaling for performance bars\n\n- **Password-Based Key Derivation**\n  - Multiple algorithm support:\n    - PBKDF2 (Password-Based Key Derivation Function 2)\n    - Argon2id (Memory-Hard Function)\n    - Scrypt (Memory-Hard Function)\n  - Configurable parameters:\n    - Iterations/work factor\n    - Memory usage (for Argon2id and Scrypt)\n    - Threads (for Argon2id)\n    - Key length\n  - Secure salt generation\n  - One-way key derivation\n  - Detailed parameter information\n  - Security recommendations\n  - Base64 encoded output\n  - Colored ASCII art visualization for benchmarks\n\n- **Diffie-Hellman Key Exchange**\n  - Authenticated key exchange implementation\n  - RSA key pairs for Alice and Bob\n  - SHA-256 hashing before RSA signing\n  - Signature verification for key authenticity\n  - AES-GCM encryption using derived shared secret\n  - TLS-like protocol demonstration\n  - MITM prevention measures\n  - Performance comparison with X25519\n\n- **X25519 Key Exchange**\n  - Modern Curve25519 implementation\n  - HKDF key derivation\n  - AES-GCM encryption demo\n  - Proper scalar validation\n  - Performance benchmarking\n  - TLS 1.3 connection flow\n  - Professional ASCII diagrams\n  - Security best practices\n\n- **JWT Support**\n  - Multiple algorithm support:\n    - HS256 (HMAC with SHA-256)\n    - RS256 (RSA with SHA-256)\n    - EdDSA (Edwards-curve Digital Signature Algorithm)\n  - JWT processor configuration\n  - Secret key management\n  - Token generation and verification\n  - Claims handling\n  - Expiration management\n\n### 🎯 Attack Simulations\n- **ECB Mode Vulnerability**\n  - Demonstrates the weakness of Electronic Codebook (ECB) mode\n  - Shows how patterns in plaintext are preserved in ciphertext\n  - Visual representation of block patterns\n  - Real-world examples of ECB vulnerabilities\n\n- **Nonce Reuse in AEAD**\n  - Simulates the catastrophic effects of nonce reuse in ChaCha20-Poly1305\n  - Demonstrates how nonce reuse breaks confidentiality\n  - Shows practical examples of nonce reuse attacks\n  - Best practices for nonce management\n\n- **Timing Attack on HMAC**\n  - Simulates timing side-channel attacks on HMAC verification\n  - Demonstrates constant-time comparison importance\n  - Shows how timing differences can leak information\n  - Countermeasures and secure implementations\n\n- **Brute Force Attacks**\n  - Simulates brute force attacks on weak keys and passwords\n  - Demonstrates password strength importance\n  - Shows time estimates for different key lengths\n  - Best practices for key and password generation\n\n- **JWT None Algorithm Attack**\n  - Demonstrates the vulnerability of accepting \"none\" algorithm\n  - Shows how to forge valid JWTs without a secret\n  - Explains proper JWT algorithm validation\n  - Security best practices for JWT implementation\n\n### 🎯 Key Features\n- Interactive CLI interface with intuitive menu system\n- Real-time step-by-step encryption process visualization\n- Detailed explanations of each algorithm's principles\n- Binary, hexadecimal, and ASCII representations\n- Educational notes and security considerations\n- Input validation and error handling\n- Factory pattern for encryption method selection\n- Modular and extensible architecture\n- Secure key storage in project directory\n- Cross-platform compatibility (Windows, Linux, macOS)\n- Performance measurements for HMAC algorithms\n- Comprehensive algorithm information display\n- Interactive loading animations for long operations\n- Version number display in welcome message\n- Colored ASCII art visualization for benchmarks\n- TLS 1.3 connection flow documentation\n- Professional ASCII diagrams for key exchange\n- Security warnings and best practices\n\n## 🚀 Installation\n\n### Prerequisites\n- Go 1.21 or higher\n- Git (for installation from source)\n\n### Using Go Install\n```bash\ngo install github.com/abdorrahmani/cryptolens@latest\n```\n\n### From Source\n```bash\n# Clone the repository\ngit clone https://github.com/abdorrahmani/cryptolens.git\n\n# Navigate to project directory\ncd cryptolens\n\n# Build the project\ngo build -o cryptolens cmd/cryptolens/main.go\n\n# Move the binary to your PATH (optional)\nmv cryptolens /usr/local/bin/\n```\n\n## 💻 Usage\n\n### Basic Usage\nRun the program:\n```bash\ncryptolens\n```\n\n### Interactive Menu\nThe program will present you with an interactive menu:\n1. Choose an encryption method (1-10)\n2. Enter your text\n3. View the detailed encryption process and explanation\n4. See the final result\n\n### Key Storage\n- Encryption keys are stored in the `keys` directory in the project root\n- RSA keys are stored as PEM files\n- AES keys are stored as binary files\n- HMAC keys are stored as binary files\n- The `keys` directory is automatically created on first run\n- Keys are securely stored with appropriate file permissions\n\n### Example Output\n```\nEncryption Process Visualization:\n=================================\nBase64 Encoding Process\n=====================\nOriginal Text: Hello\n    ↓\nASCII Values: 48 65 6c 6c 6f\n    ↓\nBinary Representation: 01001000 01100101 01101100 01101100 01101111\n    ↓\nBase64 Encoded: SGVsbG8=\n=================================\n\nDecryption Process Visualization:\n=================================\nBase64 Decoding Process\n=====================\nBase64 Encoded Text: SGVsbG8=\n    ↓\nASCII Values: 48 65 6c 6c 6f\n    ↓\nBinary Representation: 01001000 01100101 01101100 01101100 01101111\n    ↓\nDecoded Text: Hello\n=================================\n\nHMAC Example (SHA-256):\n=================================\nHMAC Process\nInput Text: Hello\n    ↓\nHMAC Key: [secure key]\n    ↓\nHMAC Result (Hex): [64 characters]\nHMAC Result (Base64): [44 characters]\n=================================\n\nPBKDF Example (Argon2id):\n=================================\nUsing argon2id for key derivation\nSalt (base64): [random salt]\n    ↓\nArgon2id Parameters:\n- Iterations: 100000\n- Memory: 65536 KB\n- Threads: 4\n- Key Length: 256 bits\n    ↓\nDerived Key (base64): [derived key]\n=================================\n\nX25519 Key Exchange:\n=================================\nAlice's Public Key: [32 bytes]\nBob's Public Key: [32 bytes]\n    ↓\nShared Secret: [32 bytes]\n    ↓\nAES-GCM Encrypted Message: [encrypted data]\n=================================\n\nJWT Example (RS256):\n=================================\nJWT Header: {\"alg\":\"RS256\",\"typ\":\"JWT\"}\n    ↓\nJWT Payload: {\"sub\":\"1234567890\",\"name\":\"John Doe\"}\n    ↓\nJWT Signature: [signature]\n    ↓\nFinal JWT: [header].[payload].[signature]\n=================================\n```\n\n# 📁 Project Structure\n\n```\ncryptolens/\n├── cmd/\n│   └── cryptolens/\n│       └── main.go           # Application entry point\n├── internal/\n│   ├── crypto/              # Encryption implementations\n│   │   ├── base64.go        # Base64 encoding/decoding\n│   │   ├── caesar.go        # Caesar cipher implementation\n│   │   ├── aes.go           # AES encryption/decryption\n│   │   ├── chacha20poly1305.go # ChaCha20-Poly1305 implementation\n│   │   ├── sha256.go        # SHA-256 hashing\n│   │   ├── rsa.go           # RSA encryption/decryption\n│   │   ├── hmac.go          # HMAC implementation\n│   │   ├── pbkdf.go         # PBKDF implementation\n│   │   ├── dh.go            # Diffie-Hellman implementation\n│   │   ├── x25519.go        # X25519 implementation\n│   │   ├── jwt.go           # JWT implementation\n│   │   ├── interfaces.go    # Encryption processor interface\n│   │   └── keymanager.go    # Key management\n│   ├── cli/                 # CLI interface components\n│   │   ├── menu.go          # Interactive menu system\n│   │   ├── display.go       # Output formatting\n│   │   ├── input.go         # User input handling\n│   │   ├── interfaces.go    # Interface definitions\n│   │   └── factory.go       # Encryption method factory\n│   ├── config/             # Configuration management\n│   │   └── config.go       # Configuration handling\n│   ├── utils/              # Utility functions\n│   │   ├── visualizer.go    # Process visualization\n│   │   └── theme.go         # Color theme management\n│   ├── input/              # Input handling\n│   │   └── input.go        # Input processing\n│   └── benchmark/          # Benchmarking tools\n│       └── benchmark.go     # Performance measurement\n├── keys/                   # Encryption keys storage\n│   ├── rsa_private.pem     # RSA private key\n│   ├── rsa_public.pem      # RSA public key\n│   ├── aes_key.bin         # AES key\n│   ├── hmac_key.bin        # HMAC key\n│   ├── dh_private.pem      # DH private key\n│   ├── dh_public.pem       # DH public key\n│   ├── x25519_private.pem  # X25519 private key\n│   └── x25519_public.pem   # X25519 public key\n├── assets/                 # Project assets\n├── config/                 # Configuration files\n│   └── config.yaml         # Default configuration\n├── LICENSE\n└── README.md\n```\n\n## 🔧 Development\n\n### Building from Source\n```bash\n# Clone the repository\ngit clone https://github.com/abdorrahmani/cryptolens.git\n\n# Navigate to project directory\ncd cryptolens\n\n# Build the project\ngo build -o cryptolens cmd/cryptolens/main.go\n\n# Run tests\ngo test ./...\n```\n\n### Adding New Features\n1. Create a new encryption implementation in `internal/crypto/`\n2. Implement the required interfaces\n3. Add the new method to the factory in `internal/cli/factory.go`\n4. Update the menu system in `internal/cli/menu.go`\n5. Add appropriate tests\n6. Update configuration in `config/config.yaml`\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Quick Start for Contributors\n```bash\n# Fork and clone\ngit clone https://github.com/abdorrahmani/cryptolens.git\ncd cryptolens\n\n# Install dependencies\ngo mod download\n\n# Run tests\ngo test ./...\n\n# Build\ngo build -o cryptolens cmd/cryptolens/main.go\n```\n\n### Development Guidelines\n- Follow Go best practices\n- Write comprehensive tests\n- Update documentation\n- Add examples\n- Follow security guidelines\n\n## 📊 Performance\n\n### HMAC Benchmark Results\n```\nAlgorithm    | Time (µs) | Relative Speed\n-------------|-----------|---------------\nBLAKE3       | 0.5       | 100%\nBLAKE2b-512  | 0.8       | 62.5%\nSHA-512      | 1.2       | 41.7%\nSHA-256      | 1.5       | 33.3%\nSHA-1        | 1.8       | 27.8%\n```\n\n### PBKDF Benchmark Results\n```\nAlgorithm | Time (ms) | Memory (MB) | Security Level\n----------|-----------|-------------|---------------\nArgon2id  | 100       | 64          | High\nScrypt    | 120       | 32          | High\nPBKDF2    | 150       | 1           | Medium\n```\n\n## 🎯 Use Cases\n\n- 🎓 **Education**: Learn cryptography concepts\n- 🔐 **Development**: Test encryption implementations\n- 🔒 **Security**: Verify cryptographic operations\n- 📚 **Research**: Experiment with different algorithms\n- 🛠️ **Testing**: Validate cryptographic functions\n- 📊 **Benchmarking**: Compare algorithm performance\n\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Go Standard Library for cryptographic functions\n- The cryptography community for educational resources\n- BLAKE3 team for their fast and secure hash function\n- All contributors who help improve this project\n\n## 📫 Contact\n\n- GitHub: [@abdorrahmani](https://github.com/abdorrahmani)\n- Project Link: [https://github.com/abdorrahmani/cryptolens](https://github.com/abdorrahmani/cryptolens) \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdorrahmani%2Fcryptolens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdorrahmani%2Fcryptolens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdorrahmani%2Fcryptolens/lists"}