for Programmers
for Programmers
for Programmers
It's here to stay
It's cool
It's part of a programmer's job
"If he had anything confidential to say, he wrote it in cipher, that is, by so changing the order of the letters of the alphabet, that not a word could be made out. If anyone wishes to decipher these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others."
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
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
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 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
Cipher | Encodes |
---|---|
ROT13 | Case insensitive 2-time letter only cipher (A-Z, a-z) |
ROT5 | 2-time cipher for numbers (0-9) |
ROT18 (13.5) | Case insensitive 2-time letters and numbers (0-9, A-Z, a-z) |
ROT47 | All visible ASCII characters 2-time cipher |
Each letter has a corresponding rotation.
EVERY
1, 5, 8, 11, 14
FAMCM
"The meeting is at the end of the street"
ROT13: GUR ZRRGVAT VF NG GUR RAQ BS GUR FBERRG
Vigenère with code 1508:
150 8150815 08 15 081 508 15 081 508150
UME UFJTQOL IA BY TPF JNL PK TPF XTZFJT
1, 5, 8, 11, 14
?, ?, ?, ??, ??
1 | 2 | 3 | 4 | 5 | |
---|---|---|---|---|---|
1 | a | b | c/k | d | e |
2 | f | g | h | i | j |
3 | l | m | n | o | p |
4 | q | r | s | t | u |
5 | v | w | x | y | z |
Polybius Square (knock Cipher)
1 | 2 | 3 | 4 | 5 | |
---|---|---|---|---|---|
1 | i | n | f | t | e |
2 | r | d | a | b | c/k |
3 | g | h | j | l | m |
4 | o | p | q | s | u |
5 | v | w | x | y | z |
Polybius Square (knock Cipher)
Key Table Passphrase "Infinite Red"
Changing the position of a character depending on a secret is called a transposition cipher.
Transposition helps hide recognizable patterns in the result.
Vigenère Cipher Key
Polybius Encoding
Message
Polybius Key Phrase
Do it again... and again... and again...
The Diffie-Hellman Key Exchange
p = 53
g = 18
x1 = 10
y1 = 38
p = 53
g = 18
x2 = 11
y2 = 48
48^10 mod 53
secret = 4
38^11 mod 53
secret = 4
Asymmetric Cryptography
Public Key
Private Key
Confidentiality
Authentication
Integrity
Nonrepudiation
Not Really... RSA Public Key was 100x's slower than DES
Fully Encrypt File
Sign/Encrypt Hash
Classic Way
Browser
Server
user/password
Cookie (Session ID)
Request + Session ID
Elevated Access Response
JWT - JSON Web Token
Browser
Auth Server
Any Service Server
user/password
signed JWT with secret
Request + JWT
Elevated Access Response
(No User DB
Needed)
@GANTLABORDE