Encryption Playground

This interactive tool allows you to experiment with different encryption algorithms and understand how they transform your data. Choose an algorithm, enter your text, and see the encryption in action.

Caesar Cipher
Vigenère Cipher
AES Encryption
RSA Encryption
Base64 Encoding
Encryption Tool

The Caesar Cipher is one of the simplest encryption techniques. It works by shifting each letter in the plaintext by a fixed number of positions down the alphabet.

Output will appear here
Security Level: Low - Educational purposes only

The Vigenère cipher is a method of encrypting alphabetic text by using a simple form of polyalphabetic substitution. It uses a keyword to shift each letter in the plaintext.

Output will appear here
Security Level: Medium - Historical cipher

Advanced Encryption Standard (AES) is one of the most widely used symmetric encryption algorithms. It operates on blocks of data and uses the same key for both encryption and decryption.

Current key length: 16 characters (AES-128)
Output will appear here
Security Level: High - Modern encryption standard

RSA is an asymmetric encryption algorithm using a pair of keys: a public key for encryption and a private key for decryption. This is a simplified demonstration.

Public key will appear here
Private key will appear here
Output will appear here
Security Level: High - Foundation of modern cryptography

Base64 is an encoding scheme used to represent binary data in ASCII string format. It's not encryption but is often used in cryptographic workflows.

Output will appear here
Security Level: Low - Encoding, not encryption
Visualization & Explanation

How Caesar Cipher Works

The Caesar cipher is a substitution cipher where each letter in the plaintext is shifted a certain number of places down the alphabet.

Example: Encrypting "HELLO" with shift 3

Each letter is moved 3 positions forward in the alphabet:

H
→ K
E
→ H
L
→ O
L
→ O
O
→ R

Result: "HELLO" becomes "KHOOR"

Alphabet Shift Visualization

This shows how each letter maps to another when shifted by 3 positions:

Plain:    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher:   D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
Security Considerations

The Caesar cipher is extremely weak because:

  • There are only 25 possible shifts (keys)
  • It can be easily broken with frequency analysis
  • Patterns in the original text remain in the ciphertext

This cipher is primarily used for educational purposes and historical context.

How Vigenère Cipher Works

The Vigenère cipher improves upon the Caesar cipher by using a keyword to determine different shift values for each letter of the plaintext.

Example: Encrypting "HELLO" with key "KEY"

The key is repeated to match the length of the plaintext:

Plaintext: H E L L O
Key:       K E Y K E

Each letter is shifted according to the corresponding key letter's position in the alphabet (A=0, B=1, ..., Z=25):

H (+K)
→ R
E (+E)
→ I
L (+Y)
→ J
L (+K)
→ V
O (+E)
→ S

Result: "HELLO" becomes "RIJVS"

The Vigenère Table

The traditional method uses the Vigenère square/table, a grid where each row represents a different Caesar cipher:

Vigenère Table Visualization

To encrypt, find the row with the key letter and the column with the plaintext letter. The intersection is the ciphertext letter.

Security Considerations

The Vigenère cipher was considered "unbreakable" for centuries, but now it can be broken with:

  • Kasiski examination - finding repeated text patterns
  • Frequency analysis - examining statistical properties
  • Index of coincidence methods

The security depends heavily on the key length and randomness. Longer keys provide better security.

How AES Encryption Works

Advanced Encryption Standard (AES) is a symmetric block cipher that processes data in fixed-size blocks using the same key for both encryption and decryption.

Key Features of AES
  • Block Size: 128 bits (16 bytes)
  • Key Sizes: 128, 192, or 256 bits
  • Rounds: 10, 12, or 14 (depending on key size)
The AES Process

AES performs several operations in rounds:

  1. SubBytes: Substituting bytes using a lookup table
  2. ShiftRows: Shifting rows of the state array
  3. MixColumns: Mixing data within columns
  4. AddRoundKey: XORing with the round key
AES Encryption Process
Security Considerations

AES is considered highly secure and is used worldwide for sensitive data protection:

  • No practical attacks against full AES have been discovered
  • Theoretical attacks require computational resources beyond current technology
  • AES-256 is approved for top secret information by the US government

The security depends on keeping the key secret and implementing the algorithm correctly.

How RSA Encryption Works

RSA is an asymmetric cryptosystem that uses a pair of keys: a public key for encryption and a private key for decryption.

The Key Generation Process
  1. Choose two large prime numbers, p and q
  2. Compute n = p × q
  3. Calculate φ(n) = (p-1) × (q-1)
  4. Choose e (public exponent) such that 1 < e < φ(n) and gcd(e, φ(n)) = 1
  5. Compute d (private exponent) such that d × e ≡ 1 (mod φ(n))

Public key: (n, e)
Private key: (n, d)

Encryption and Decryption

For a message m:

Encryption: c = m^e mod n
Decryption: m = c^d mod n
RSA Encryption Process
Security Considerations

RSA security relies on the computational difficulty of factoring large numbers:

  • The security increases with key size (2048 or 4096 bits recommended)
  • Quantum computers pose a theoretical threat to RSA
  • Proper implementation is critical to prevent side-channel attacks

RSA is often used to encrypt small amounts of data or to exchange symmetric keys.

How Base64 Encoding Works

Base64 is an encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation.

The Encoding Process

Base64 encoding works by:

  1. Taking 3 bytes (24 bits) of binary data
  2. Splitting it into 4 groups of 6 bits each
  3. Converting each 6-bit value to a character in the Base64 alphabet (A-Z, a-z, 0-9, +, /)

Original text: "Man"

ASCII values: M (77), a (97), n (110)

Binary: 01001101 01100001 01101110

Grouped into 6 bits: 010011 010110 000101 101110

Base64 values: 19, 22, 5, 46

Base64 characters: T, W, F, u

Result: "TWFu"

Padding

If the input length is not divisible by 3, padding is added with the "=" character:

"M"     → 01001101 00000000 00000000 → "TQ=="
"Ma"    → 01001101 01100001 00000000 → "TWE="
Use Cases and Considerations

Base64 is not encryption, but encoding. It's commonly used for:

  • Embedding binary data in text formats like JSON or XML
  • Encoding email attachments (MIME)
  • Embedding image data directly in HTML/CSS
  • Transmitting binary data over text-only protocols

It increases data size by approximately 33% but ensures safe transmission through text-based systems.