Classical Ciphers Lab
The Classical Ciphers Lab lets you experiment with historical encryption techniques. Each cipher demonstrates a different approach to hiding information. Below you'll find detailed documentation for each cipher:
Caesar Cipher
- Background: The Caesar cipher is a simple substitution cipher where each letter in the plaintext is shifted by a fixed number of positions down the alphabet. Named after Julius Caesar, who used it in his private correspondence.
- How it works: For a shift of 3, A becomes D, B becomes E, etc. The alphabet wraps around (Z becomes C).
- How to use in lab: Select Caesar, enter your message and shift value, and click Encrypt or Decrypt. The result appears instantly.
- Example:
HELLO
with shift 3 →KHOOR
- Tips: Only works well for English letters. Not secure for real use.
Affine Cipher
- Background: The Affine cipher is a type of monoalphabetic substitution cipher that uses mathematical functions to encrypt each letter. It uses the formula:
E(x) = (ax + b) mod 26
. - How it works: Each letter is mapped to a number (A=0, B=1, ...), then transformed using the formula. The key is a pair of numbers (a, b), where a must be coprime with 26.
- How to use in lab: Select Affine, enter your message, a, and b values, and click Encrypt or Decrypt.
- Example:
HELLO
with a=5, b=8 →RCLLA
- Tips: If decryption fails, check that 'a' is coprime with 26.
Rail Fence Cipher
- Background: The Rail Fence cipher is a transposition cipher that writes the message in a zigzag pattern across multiple "rails" and then reads off each row.
- How it works: For 3 rails, the message is written in a zigzag and then read row by row.
- How to use in lab: Select Rail Fence, enter your message and number of rails, and click Encrypt or Decrypt.
- Example:
WEAREDISCOVERED
with 3 rails →WECRLTEERDSOEEVD
- Tips: Works best for longer messages.
Transposition Cipher
- Background: The Transposition cipher rearranges the letters of the plaintext according to a defined system, without changing the actual letters.
- How it works: The message is written in a grid and columns are rearranged according to a key.
- How to use in lab: Select Transposition, enter your message and key, and click Encrypt or Decrypt.
- Example:
HELLO WORLD
with key 3,1,2 →LEHLOWORLD
- Tips: Key must be a permutation of column numbers.
ROT13 Cipher
- Background: ROT13 is a special case of the Caesar cipher with a fixed shift of 13. It is its own inverse (applying it twice returns the original text).
- How it works: Each letter is replaced by the letter 13 positions after it in the alphabet.
- How to use in lab: Select ROT13, enter your message, and click Encrypt/Decrypt.
- Example:
HELLO
→URYYB
- Tips: Useful for obscuring spoilers or simple text, not for security.
One-Time Pad
- Background: The One-Time Pad is a theoretically unbreakable cipher if the key is truly random, as long as the key is as long as the message and used only once.
- How it works: Each letter of the message is combined with a letter from the key using modular addition.
- How to use in lab: Select One-Time Pad, enter your message and a random key of the same length, and click Encrypt/Decrypt.
- Example:
HELLO
with keyKDWLP
→RIXZW
- Tips: Key must be truly random and never reused for perfect secrecy.
General Tips for Classical Ciphers Lab
- Use the step-by-step explanation feature to see how each cipher works internally.
- Try encrypting and decrypting the same message to understand reversibility.
- For educational use only—these ciphers are not secure for real-world data.
- Check the UI for error messages if your input or key is invalid.
Steganography Lab
The Steganography Lab allows you to hide secret messages inside images using the Least Significant Bit (LSB) technique. This method subtly changes the pixel data so the message is invisible to the naked eye.
- Supported Formats: PNG and JPG images. PNG is recommended for best results.
- How it works: The LSB of each pixel is replaced with bits from your message. The change is visually undetectable but can be extracted by the lab.
- How to use in lab: Upload an image, enter your secret message, and click Hide. Download the new image or use the Extract feature to reveal hidden messages.
- Example: Hide
HELLO
in a PNG image. The output image looks identical but contains the message. - Tips: Use high-resolution images for larger messages. Avoid compressing the image after hiding data.
- Security Note: Steganography hides the existence of a message but does not encrypt it. For sensitive data, encrypt before hiding.
- Troubleshooting: If extraction fails, ensure the image was not altered or compressed after hiding the message.
File Encryption Lab
The File Encryption Lab lets you encrypt and decrypt files using modern cryptographic algorithms (e.g., AES). All encryption is performed in your browser for privacy and security.
- Supported Files: Any file type up to 10MB. Larger files may not be supported due to browser limitations.
- How it works: Files are encrypted using a password-derived key (KDF). The encrypted file can only be decrypted with the same password.
- How to use in lab: Upload a file, enter a strong password, and click Encrypt. Download the encrypted file. To decrypt, upload the encrypted file and enter the password.
- Example: Encrypt
document.pdf
with passwordMy$trongP@ss
. The output is a .enc file. - Tips: Use a unique, strong password for each file. Remember your password—there is no recovery!
- Security Note: All encryption is client-side. Files are never uploaded to the server.
- Troubleshooting: If decryption fails, check your password and file type. Corrupted or altered files cannot be decrypted.
Advanced Details
- Algorithm: AES-GCM is used for encryption, providing confidentiality and integrity.
- Password Handling: Passwords are converted to keys using PBKDF2 or a similar KDF with salt and iterations for security.
- File Size Limit: 10MB per file (browser limit).
- Error Handling: The lab shows clear error messages for unsupported files, wrong passwords, or decryption errors.
Digital Signatures Lab
The Digital Signatures Lab lets you experiment with cryptographic signatures, which provide authenticity and integrity for messages and files. The lab supports RSA and ECDSA algorithms, as well as various hash functions.
- Key Generation: Generate a public/private key pair (RSA or ECDSA). Keys are generated in your browser and never leave your device.
- Signing: Enter a message, select an algorithm and hash function, and click Sign. The lab creates a digital signature using your private key.
- Verification: Paste a signature and public key to verify a message's authenticity.
- Example: Sign
Hello World
with RSA-2048 and SHA-256. The output is a base64 signature. - Tips: Keep your private key safe. Never share it. Use the lab to see how changing the message or key changes the signature.
- Hash Functions: SHA-256, SHA-512, BLAKE2, and MD5 are available for experimentation.
- Security Note: All cryptographic operations are client-side. Keys and signatures are never sent to the server.
- Troubleshooting: If verification fails, check the message, signature, and public key for typos or mismatches.
Advanced Details
- RSA: Asymmetric algorithm using large prime numbers. Commonly used for digital signatures and encryption.
- ECDSA: Elliptic Curve Digital Signature Algorithm. More efficient than RSA for the same security level.
- Hashing: Hash functions create a unique fingerprint of your message. Changing one character changes the hash completely.
- Key Storage: Keys are stored in memory only. Refreshing the page erases them.
Learning Resources
Access curated guides, books, and interactive tools to deepen your understanding of cryptography, steganography, and digital security. Resources are organized by lab and topic.
- How to Use: Browse resources by lab or topic. Click to view details or download materials.
- Features: Book recommendations, guides, and external links.
- Tips: Start with beginner guides if you're new, or explore advanced topics for deeper learning.
Home
The Home page is your starting point for exploring all labs and features. It provides quick access, highlights new updates, and summarizes your options.
- How to Use: Click any lab card to jump directly to that lab. Use the navigation bar for quick access to all sections.
- Features: Modern hero, lab cards, testimonials, and stats.
- Tips: Check the home page for new features and announcements.
Contact & Support
Need help or want to give feedback? Use the Contact page to send messages, report issues, or connect via email/social media.
- How to Use: Fill out the contact form or use the direct contact options (email, WhatsApp, Instagram).
- Features: Modern contact cards, error dialogs, and direct links.
- Tips: For urgent issues, use email for the fastest response.