(Draft) Intro To Cryptography (Recovered)
(Draft) Intro To Cryptography (Recovered)
Course objectives:
Learn how crypto primitives work
Learn how to use them correctly and reason about security
Course Outlines
Introduction
Symmetric Encryption
Asymmetric Encryption
Hashing
Digital Certificate
Book
Cryptography is everywhere
Secure communication:
User authentication
no eavesdropping
no tampering
Secure Sockets Layer / TLS
Disk
No eavesdropping
No tampering
File 2
Talking Talking
to Bob to Alice
Secret key establishment:
Alice
Bob
attacker???
Secure communication:
k m1
k
m2
confidentiality and integrity
But crypto can do much more
Digital signatures
Anonymous communication
Who did I
just talk to?
Alice
Alice
Bob signature
But crypto can do much more
Digital signatures
Anonymous communication
Who
1$ Alice was
Internet that?
(anon. comm.)
Protocols
Elections
Private auctions
Protocols
Elections
Private auctions
trusted
Goal: compute f(x1, x2, x3, x4)
authority
“Thm:” anything that can done with trusted auth. can also
be done without
Secure multi-party computation
Crypto magic
Privately outsourcing computation What did
she search
for?
search
query E[ query ]
Alice
E[ results ]
Zero knowledge (proof of knowledge)
results
???
Cryptography is:
A tremendous tool
The basis for many security mechanisms
Cryptography is not:
The solution to all security problems
Reliable unless implemented and used properly
Something you should try to invent yourself
ciphertext only
only know algorithm & ciphertext, is statistical, know or can identify plaintext
known plaintext
know/suspect plaintext & ciphertext
chosen plaintext
select plaintext and obtain ciphertext
chosen ciphertext
select ciphertext and obtain plaintext
chosen text
select plaintext or ciphertext to en/decrypt
More Definitions
unconditional security
no matter how much computer power or time is available, the cipher cannot be
broken since the ciphertext provides insufficient information to uniquely determine
the corresponding plaintext
computational security
given limited computing resources (eg time needed for calculations is greater
than age of universe), the cipher cannot be broken
Brute Force Search
Key Size (bits) Number of Alternative Avg. Time required at 1 Avg. Time required at 106
Keys decryption/µs decryptions/µs
32 232 = 4.3 109 231 µs = 35.8 minutes 2.15 milliseconds
56 256 = 7.2 1016 255 µs = 1142 years 10.01 hours
128 2128 = 3.4 1038 2127 µs = 5.4 1024 years 5.4 1018 years
168 2168 = 3.7 1050 2167 µs = 5.9 1036 years 5.9 1030 years
26 characters 26! = 4 1026 2 1026 µs = 6.4 1012 years 6.4 106 years
(permutation)
Classical Substitution Ciphers
What if we shuffle the letters arbitrarily (i.e. uses Arbitrary Substitution / Permutation).
Each plaintext letter maps to a different random ciphertext letter, hence key is 26 letters
long
How much does it take to break the encryption (being able to recognize plaintext)?
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Arbitrary Substitution | Permutation
given ciphertext:
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Playfair Cipher
Playfair Cipher
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Encrypting and Decrypting
Example:
17 17 5 4 9 15
𝐾 = 21 18 21 , 𝐾 −1 = 15 17 6
2 2 19 24 0 17
It is easy to be broken by known plaintext attack by solve the following
equation:
𝐶 = 𝑃𝐾
Case 1: if P-1 exists, then 𝑲 = 𝑷−𝟏 𝑪
Case2: if P-1 not exist, then change P and C until P-1 found
Hill Cipher | Quiz
𝑎 𝑏
𝐾= ,
𝑐 𝑑
6 14 𝐾 = 6𝑎 + 14𝑐 6𝑐 + 14𝑑 = 2 24
11 3 𝐾 = 11𝑎 + 3𝑐 11𝑐 + 3𝑑 = 5 25
11 2 − 14𝑐 + 18𝑐 22 − 136𝑐
= =5
6 6
22 − 30 −8 1
𝑐= = =− = −1 × 17−1 = −1 × 23 = 3
136 136 17
Hill Cipher | Quiz
1 3 4 −3
𝑷= , 𝑷−𝟏 =
1 4 −1 1
4 −3 11 21 2 3
𝑲 = 𝑷−𝟏 𝑪 = =
−1 1 14 1 3 6
Polyalphabetic Cipher
A Set of Related Monoalphabetic
Substitution Rules
Polyalphabetic Ciphers
if a truly random key as long as the message is used, the cipher will be secure
called a One-Time pad
is unbreakable since ciphertext bears no statistical relationship to the plaintext
since for any plaintext & any ciphertext there exists a key mapping one to
other
can only use the key once though
problems in generation & safe distribution of key
Perfect Secrecy
an alternative to encryption
hides existence of message
using only a subset of letters/words in a longer message marked in some way
using invisible ink
hiding in LSB in graphic image or sound file
has drawbacks
high overhead to hide relatively few info bits
Summary
have considered:
classical cipher techniques and terminology
monoalphabetic substitution ciphers
cryptanalysis using letter frequencies
Playfair cipher
polyalphabetic ciphers
transposition ciphers
product ciphers and rotor machines
stenography
Secure Usage of Symmetric Encryption