6. CRYPTO 101
ASCII ENCODING
6
! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ 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 [ ] ^ _
` 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 { | } ~
7. CRYPTO 101
ATTACK AT DAWN
7
A 65 0100 0001
T 84 0101 0100
T 84 0101 0100
A 65 0100 0001
C 67 0100 0011
K 75 0100 1011
32 0010 0000
A 65 0100 0001
T 84 0101 0100
32 0010 0000
D 68 0100 0100
A 65 0100 0001
W 87 0101 0111
N 78 0100 1110
14. CRYPTO 101
ONE-TIME PAD KEY
▸ As long as the plaintext
14
9a5c77ee252bcf257ef199dae13c
1001 1010 0101 1100 0111 0111 1110 1110
0010 0101 0010 1011 1100 1111 0010 0101
0111 1110 1111 0001 1001 1001 1101 1010
1110 0001 0011 1100
15. CRYPTO 101
IS ONE-TIME PAD GOOD ENOUGH?
▸ Not practical in real life
▸ “ATTACK AT DAWN” - 14 Bytes (B)
▸ A letter - 3 Kilo Bytes (KB)
▸ An audio - 4 Mega Bytes (MB)
▸ A video - 2 Giga Bytes (GB)
▸ Can we do better?
15
30. CRYPTO 101
THE PROBLEM
▸ How to hide a secret message?
▸ How to securely send my secret message to others?
30
31. CRYPTO 101
ALICE, BOB & EVE
31
secret
Alice -------------------------------------------> Bob
key key
secret secret'
Alice ------------------ Eve --------------------> Bob
key key
32. CRYPTO 101
CRYPTOGRAPHIC HASH FUNCTIONS
▸ Data integrity
32
secret
Alice -------------------------------------------> Bob
key key
secret
digest
Alice -------------------------------------------> Bob
key key
33. CRYPTO 101
IDEAL HASH FUNCTIONS
▸ digest = hash_function(input)
▸ Deterministic, same input always results in same digest
▸ Quick to compute for any input
▸ One-way function
▸ Avalanche effect, small change in input cause huge change in
digest
▸ Collision resistance, infeasible to find two different inputs with
same digest
33
36. CRYPTO 101
IS DATA INTEGRITY ENOUGH?
36
secret
digest
Alice -------------------------------------------> Bob
key key
secret secret’
digest digest’
Alice ------------------ Eve --------------------> Bob
key key
37. CRYPTO 101
MAC (MESSAGE AUTHENTICATION CODE)
▸ Data integrity & authentication
▸ tag = mac_function(key, input)
▸ CMAC/CBC-MAC/VMAC/UMAC
▸ HMAC
▸ tag = hmac(hash_function, key, input)
▸ Poly1305
37
39. CRYPTO 101 39
secret
tag
Alice -------------------------------------------> Bob
(key, key2) (key, key2)
secret
digest
Alice -------------------------------------------> Bob
key key
secret secret’
tag ??????
Alice ------------------ Eve --------------------> Bob
(key, key2) (key, key2)
43. CRYPTO 101
THE PROBLEM
▸ How to hide a secret message?
▸ How to securely send my secret message to others?
43
44. CRYPTO 101 44
secret secret’
tag ??????
Alice ------------------ Eve --------------------> Bob
(key, key2) (key, key2)
secret
tag
Alice -------------------------------------------> Bob
(key, key2) (key, key2)
(key, key2)
Alice ------------------ Eve --------------------> Bob
?????
45. CRYPTO 101
RESOURCES
▸ Cryptography I - Dan Boneh, Professor, Stanford U
▸ https://www.coursera.org/learn/crypto
▸ Enroll starts Aug 07, 2017
45