CryptoLab is an educational web application designed to help students and enthusiasts learn cryptography through interactive tools, challenges, and quizzes. The platform covers classical ciphers to modern encryption algorithms with hands-on practice.
This is a complete cryptography learning platform that includes:
- Interactive Cipher Tools - Try encryption/decryption with step-by-step visualization
- Educational Content - Detailed explanations of how each cipher works
- Practice Challenges - Solve puzzles to test your understanding
- Knowledge Quizzes - Test your theoretical knowledge
- AI Chat Assistant - Get help with cryptography concepts
src/App.jsx- Main application component that handles routing between different pagessrc/main.jsx- Entry point that renders the app and includes global stylessrc/index.css- Global styling for the entire applicationsrc/overflow-fix.css- Responsive fixes to prevent text inputs from overflowing screen
src/components/Home.jsx- Landing page with navigation to all cipher tools and features
Each cipher has its own component with three main sections:
- Tool Tab - Interactive encryption/decryption with step-by-step visualization
- About Tab - Comprehensive explanation of the algorithm
- Challenge/Quiz Links - Practice and testing options
src/components/c1-ceaser.jsx- Caesar Cipher (shift letters by a fixed number)src/components/c2-playfair.jsx- Playfair Cipher (5x5 grid encryption using digrams)src/components/c3-hill.jsx- Hill Cipher (matrix multiplication encryption)src/components/c4-otp.jsx- One-Time Pad (perfect encryption with random key)src/components/c5-vigenere.jsx- Vigenère Cipher (keyword-based polyalphabetic substitution)src/components/c6-vernam.jsx- Vernam Cipher (binary XOR encryption)src/components/c7-railfence.jsx- Rail Fence Cipher (zigzag pattern transposition)src/components/c8-des.jsx- DES (Data Encryption Standard with 16 rounds)src/components/c9-aes.jsx- AES (Advanced Encryption Standard, modern encryption)src/components/c10-rsa.jsx- RSA (Public key cryptography)
src/components/byoc.jsx- "Bring Your Own Cipher" - Custom cipher implementation toolsrc/components/c0-cipher.jsx- General cipher introduction and overview
Interactive puzzles where users solve cryptography problems:
src/components/challenges/CaesarChallenge.jsx- Solve Caesar cipher puzzles with timersrc/components/challenges/CaesarChallenge_new.jsx- Updated version with better UIsrc/components/challenges/playfair.jsx- Playfair cipher solving challengessrc/components/challenges/playfair_new.jsx- Enhanced playfair challengessrc/components/challenges/hill_new.jsx- Hill cipher matrix challengessrc/components/challenges/otp_new.jsx- One-time pad challengessrc/components/challenges/railfence.jsx- Rail fence pattern challengessrc/components/challenges/railfence_new.jsx- Updated rail fence challengessrc/components/challenges/vernam.jsx- Binary XOR challengessrc/components/challenges/vigenere.jsx- Keyword-based cipher challenges
- Timer System - Time limits for each challenge
- Hint System - Progressive hints when users get stuck
- Step-by-step Guidance - Visual feedback during solving
- Score Tracking - Points based on time and hints used
Multiple choice quizzes to test theoretical understanding:
src/components/quizz/caesarquiz.jsx- Caesar cipher theory quizsrc/components/quizz/playfair.jsx- Playfair cipher concepts quizsrc/components/quizz/hill.jsx- Hill cipher mathematics quizsrc/components/quizz/otp.jsx- One-time pad security quizsrc/components/quizz/otp_new.jsx- Updated OTP quiz formatsrc/components/quizz/railfence.jsx- Rail fence algorithm quizsrc/components/quizz/vernam.jsx- Vernam cipher quizsrc/components/quizz/vigenere.jsx- Vigenère cipher quizsrc/components/quizz/des.jsx- DES algorithm quizsrc/components/quizz/aes.jsx- AES modern cryptography quizsrc/components/quizz/rsa.jsx- RSA public key cryptography quiz
- Multiple Choice Questions - 4 options per question
- Instant Feedback - Immediate right/wrong indication
- Score Calculation - Percentage-based scoring
- Detailed Explanations - Learn from incorrect answers
Intelligent assistant for cryptography help:
src/components/ChatInterface.jsx- Main chat interface with message historysrc/components/FloatingChatButton.jsx- Always-accessible chat buttonsrc/components/chat/UserMessage.jsx- User message display componentsrc/components/chat/AIMessage.jsx- AI response display componentsrc/components/chat/LoadingIndicator.jsx- Shows when AI is thinkingsrc/components/chat/ErrorMessage.jsx- Error handling displaysrc/components/chat/ScreenshotMessage.jsx- Screenshot sharing capability
- Context-Aware Help - Understands which cipher you're working on
- Screenshot Analysis - Can analyze your screen to provide specific help
- Educational Guidance - Explains concepts rather than just giving answers
- Multi-language Support - Responds in multiple languages
src/services/AIChatService.js- Handles communication with Gemini AIsrc/config/gemini.js- AI configuration and API setupsrc/hooks/useAIChat.js- React hook for chat functionality
src/utils/screenshotUtils.jsx- Screen capture functionalitysrc/utils/useScreenshot.js- Hook for screenshot managementsrc/context/CipherContext.jsx- Global state management for cipher datasrc/context/useCipherIntegration.js- Integration between ciphers and AI
src/index.css- Global styles, layout, and responsive designsrc/App.css- Application-specific stylingsrc/components/ChatInterface.css- Chat system stylingsrc/components/challenges/ChallengeStyles.css- Challenge component stylessrc/components/quizz/QuizStyles.css- Quiz component stylessrc/components/chat/MessageStyles.css- Chat message styling
- Responsive Design - Works on mobile, tablet, and desktop
- Dark Theme - Eye-friendly dark color scheme
- Consistent UI - Unified design language across all components
- Accessibility - Screen reader friendly and keyboard navigation
- User Input - Enter text and encryption key
- Mode Selection - Choose encrypt or decrypt
- Step Visualization - See each step of the algorithm
- Result Display - Get encrypted/decrypted output
- Copy Function - Easy copying of results
- Problem Generation - Random puzzles created for each attempt
- Timer Start - Countdown begins when challenge starts
- User Solving - Interactive interface for problem solving
- Hint System - Progressive clues available
- Validation - Automatic checking of answers
- Score Calculation - Points based on time and hints used
- Question Display - Multiple choice questions presented
- Answer Selection - Click to choose answers
- Immediate Feedback - Right/wrong shown instantly
- Progress Tracking - Current question number displayed
- Final Score - Percentage score at completion
- Context Detection - Knows which page you're on
- Question Processing - Understands cryptography queries
- Response Generation - Educational explanations provided
- Screenshot Analysis - Can analyze visual problems
- Follow-up Support - Continues conversation naturally
- Node.js (version 14 or higher)
- npm or yarn package manager
- Modern web browser
- Clone or download this project
- Open terminal in project folder
- Run:
npm install(installs all required packages) - create .env file and add VITE_GEMINI_API_KEY="--provide your key here--"
- Run:
npm run dev(starts development server) - Open browser to
http://localhost:5173
- Vite - Fast development server and build tool
- React - User interface framework
- React Router - Navigation between pages
- Tailwind CSS - Utility-first CSS framework
- Google Gemini AI - Intelligent chat assistant