๐ฎ Cheat activated โ skipping to text encryption
Hybrid Encryption โ Wrap a Key, Send a Message
In plain English
p =
q =
Or type one:
No quick picks available โ type a value yourself:
Your toy lesson script
Your full Python script
Playground
Type anything (โค500 printable ASCII chars). The table re-encrypts as you type, using .
ยท decoded:
In the real world
What you just did is textbook RSA โ the bare math. Production systems differ in three important ways:
- RSA almost never encrypts the actual message. Each RSA block can only hold a number smaller than n โ for a 2048-bit key that's ~214 bytes after padding. For anything larger, you don't split-and-RSA. You generate a random AES key, RSA-encrypt that key (one small block), then AES-encrypt the message (no size limit). HTTPS, SSH, and PGP all work this way. It's called hybrid encryption.
-
Real RSA always uses padding.
Your per-character ciphertext leaks the alphabet โ every
einwould encrypt to the same number, so frequency analysis breaks it instantly. Real protocols use OAEP padding to add randomness, so the same plaintext produces different ciphertexts each time. - RSA also signs. Same math, opposite roles: hash the message (SHA-256), RSA-encrypt the hash with your private key. Anyone can verify with your public key. The message itself can be any size because only the fixed-size hash is touched by RSA.
AES S-box (highlighted cell = answer for input 0x53)
Row 1 (input)
โ
Row 1 (after shift left by 1)
??
One column (input)
ร
[2 3 1 1]
[1 2 3 1]
[1 1 2 3]
[3 1 1 2]
(GF(2โธ))
[2 3 1 1]
[1 2 3 1]
[1 1 2 3]
[3 1 1 2]
(GF(2โธ))
โ
Output column
State byte
0xED (237 = 11101101)
XOR
Round-key byte
0x2B (43 = 00101011)
=
Output
??
A real 16-byte state going through all four transformations of one round. Demo uses a fixed input + round key; values computed client-side via the actual S-box, ShiftRows offsets, MixColumns matrix, and XOR.
Original:
AES-128 key:
IV (nonce):
Ciphertext:
Decrypted: โ matches
โ
| char | binary | ascii | encrypted |
|---|---|---|---|
Original:
Encrypted:
Decrypted:
โ matches
Python for this step