Download presentation
1
Cryptography Kρύπτω (kryptos)– Hidden Secret writing
The message is not hidden Encrypt Change information from one form to another to hide its meaning It is the conerstone of security
2
Threats to a message
3
Message Message Alice Bob
4
Eavesdropping Message Alice Bob Eve
5
Interception Message Alice Mallory Bob
6
Modification Message Message Alice Mallory Bob
7
Fabrication Alice Bob Message “Alice”
8
Basic Idea Encryption Plaintext Ciphertext Decryption Ciphertext
This the Infromation Security class in Monterrey Tech Encryption Esta es la clase De Seguridad Informática en El Tecnológico De Monterrey Plaintext Ciphertext Esta es la clase De Seguridad Informática en El Tecnológico De Monterrey Decryption This the Infromation Security class in Monterrey Tech Ciphertext Plaintext
9
Consistency equation (symmetric ciphers)
E(k,m) m=D(k,E(k,m)) D(k,E(k,m)) m
10
Basic principles of security
Confidentiality Privacy, secret messages Integrity Message does not change in transit Availabilty Authentication Validate identity of Non-repudiation Sender cannot deny sending the message Receiver cannot deny receiving the message
11
Scytale (700 A de C)
12
Cesar (ROT 3) n = 3 50 AC
13
ROT 13 n = 13
14
PigPen cipher (18th century)
15
Frequency analysis English Spanish
Problema con cifradores de sustitución monoalfabéticos
16
Mary Queen of Scots
17
Frequency analysis
18
Polyalphabetic cipher
Leon Alberti 1460s Proposed the use of multiple alphabets to cipher a single message Blaise de Vigenère 1586 He is credited with the implementation of the ideas of Alberti
19
Example ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC
Original alphabet DEFGHIJKLMNOPQRSTUVWXYZABC Cipher alphabet 1 NOPQRSTUVWXYZABCDEFGHIJKLM Cipher alfabet 2 JAVAXJALA Plain text: MDYDAMDOD Cipher text with alpahbet 1 MNYNAWDYD Cipher text with the two alpahbets
20
Vigenère cipher
21
“One-time Pad” Te perfect cipher
The key is a random sequence of numbers Key and message haver the same length Use to fight the frequency analysis Two problems Absolute synchronization between sender and receiver Number of keys is limited (distribution)
22
Enigma
23
Ciphers Private key Public key
24
General ci = E(pi,n) = pi + n mod 26 Substitution Ciphers
Each character is changed (substituted) by another character or symbol A → C, B → D, Cesar ci = E(pi) = pi + 3 General ci = E(pi,n) = pi + n mod 26
25
Monoalphabetic Cipher
Each letter in the plaintext is changed by the the same letter in the ciphertext Using 3 as the key ABCDEFGHIJKLMNOPQRSTUVWWXYZ defghijklmnopqrstuvwwxyzabc using “palabra” as the key palbrcdefghijkmnoqstuvwwxyz
26
Polialphabetic Cipher
A letter in the plantext can be replaced by a different letter in the ciphertext Vigenère: C = P + K mod 26 Usando “secreto” como llave Plaintext: ESTEMENSAJEESFACIL Key: secretosecretosecr Ciphertext: wwvvqxbkelviltsgkc
27
Transposition Cipher The symbols do not change they are just rearrenged SECURITY → ITRUCYES PERMUTATIONS Transposition by columns ESTEM ENSAJ EESMA SDIFI CILDE DESCI FRARA EEESC DFSNE DIERT SSILS AEAMF DCRMJ AIEIA
28
Stream and block ciphers
29
A secure encryption algorithm
Based in solid mathematical principles Cryptographers Analized by competent people Cryptoanalists It has endured through time Basic principles: Confusion Diffusion
30
Principles Confusion Non evident relationship between plaintext/key/ciphertext What happens if I change one symbol in the plaintext. The change in the ciphertext cannot be predicted Avoid clear patterns Diffusion Spread the information of the plaintext over the entire ciphertext The interceptor requires access to much of the ciphertext to deduce the algorithm
31
Stream and block ciphers
(+) Good speed of transformations (+) Loe error propagation (-) Low diffusion (-) Susceptible to malicious insertions Bloques (+) High diffusion (+) Inmunity to malicious insertions (-) Slow in the process of encryption (-) High proagation of errors
32
The cryptographer's dilemma
“An encryption algorithm must be regular for it to be algorithmic and for cryptographers to be able to remember it. Unfortunately, the regularity gives clues to the cryptoanalyst”
33
Crytographic algorithms
The majority uses binary arithmetic Easier to handle Fast to process Everything is digital anyways!
34
DES (Data Encryption Standard)
1973: NBS (now NIST) calls for the design of a commercial algorithm Public use NSA was involved.....discretely “Intentional weaknesses” (?) Small keys (56 bits) y blocks of 64 bits IBM gets in with Lucifer Horst Feistel algorithm, developed in the early 70s in IBM Block cipher with private key (symmetric) Originally the keys and the bolcks were 128 bits German inmigrate, 1934 1976: NBS adopts IBM cipher as the industry standard 1997: It is successfully attacked (brute force) 2000: NIST changes to AES
35
DES Block cipher Operates on 64 bits blocks of data 64 bits key
But the “real” length is 56 bits 8 bits are used as parity bits 16 rounds of subtstitutions and permutations determined by S-Boxes and P-Boxes The same algorithm for decrytion
36
DES general structure IP: Initial Permutation FP: Final Permutation
IP y FP are inverse Operates over 64 bits blocks F: Feistel function
38
Initial Permutation (IP)
39
Feistel Function Expansion and Permutation S box (Substitution)
One (different) for each Round. “key schedule” 48 bits S box (Substitution) 6 bits input 4 bits output 32 bits
40
Feistel Function
41
Expansion Function (E)
42
S-Boxes (substitution)
43
S1 Input: Row: 1yyyy Column: x0110x Output: 0010 (2)
44
Permutation (P)
45
Key schedule PC1 (Permuted Choice 1) 64 bits to 56 bits Permutation
2 halves of 28 bits Independently rotated 1 or 2 positions PC2 (Permuted Choice 2) 56 bits input 48 bits output
46
64 bits 56 bits 28 bits 28 bits 1 or 2 positions 1 or 2 positions
47
Permutated Choice 1 (PC-1)
48
Rotations in the Key schedule
49
Permutated Choice 2 (PC-2)
50
Final Permutation (FP)
51
FP = IP-1
53
Double DES E(k2, E(k1,m)) Encrypt the message twice with two different keys Key of 112 bits (?) It does not give more security 257 = 2*256 brute force attack “meet in the middle” attack
54
Triple DES C = E(k3,D(k2, E(k1,m))) Keys of 168 bits (?)
Equivalent to 118 bits keys. Variation of triple DES C = E(k1,D(k2, E(k1,m))) Equivalent 80 bits keys 90 bits keys are good enough now
55
DES security under scrutiny
The design criteria were never made public Many thought NSA “installed” a “backdoor” NSA modified the S-boxes Walter Tuchman working for IBM in a modified version of Lucifer. Then NSA brought him to work with them The size of the key was small. Rumor has it NSA influenced in this NSA wanted a 48 bits key
56
DES security under scrutiny
Up to this day. An intentional weakness has not been discovered. And it has been test a lot! In 1990 Eli Biham and Adi Shamir published a method to break block ciphers (differential cryptanalysis). The S-Boxes of DES were very resistance to the attack "It took the academic community two decades to figure out that the NSA 'tweaks' actually improved the security of DES." Bruce Schneier The biggest threat is brute force attacks
57
DES survival 1977: Diffie and Hellman
Proposed a machine which could break DES in a day $20,000,000 US 1993: Wiener Proposed a machine to find the key in 7 hours $1,000,000 None of them were implemented At leas publicly
58
DES survival 1997: RSA Security offer $10,000 to the first place
Project DESCHALL won using Internet in 3 months “DESCHALL Project”. Wikipedia 1998: “Deep Crack” machine from EFF $250,000 US machine broke DES in 56 hours "There are many people who will not believe a truth until they can see it with their own eyes. Showing them a physical machine that can crack DES in a few days is the only way to convince some people that they really cannot trust their security to DES." “EFF DES cracker”. Wikipedia 2006: COPACOBONA Two universities from Germany, $10,000 US machine 120 FPGAs 7 days In 2008 they reduced the time to less than one day
59
AES (Advanced Encryption Standard)
1997: NIST published RFP 1999: 5 finalists 2001: They chose Rijndael Invented by Vincent Rijmen y Joan Daemen, originaly called Rijndael (“raindel”) Official government standar since may of 2002 Private key algorithm (symmetric) 128 bits blocks and keys of 128, 192 ó 256 bits 9, 11 ó 13 rounds of substitutions, rotations and mixing of bits, depending on the size of the key
60
AES in action
61
Keys distribution DES and AES solved the problem of standardization and allowed businesses (banks) to use cryptography The problem is: How do I send the key before starting a ciphered communication Having an adequate scheme requires resources (money) A bank has thousands of clients, a different key for each one of them And renew the key periodically COMSEC distributes keys in USA
62
Keys handling C1 C2 K12 K13 K23 K14 K23 C3 C4 K34 Each user n-1 keys
63
A better solution C1 C2 K1 K2 TTP (Trusted Third Party) K4 K3 C3 C4
E(K1, “1,2”||K12) E(K2, “1,2”||K12) Ticket Each user needs only ONE key
64
Key distribution Might seem a trivial problem
But soon became an unmanageable situation Later on it was claimed an unsolvable problem Typical “Catch 22” situation … until mid 70s
65
God rewards fools Ralph Merkle, Martin Hellman and Whitfield Diffie
66
Whitfield Diffie Born in 1944, 1995 MIT Math graduate Martin Hellman Born in 1945, 1969 Stanford PhD Ralph Merkle 1977 Stanford PhD
67
Sending a secret message
¿Y la llave? Alice Bob
68
Sending a secret message without previous key exchange
Alice Bob Alice Bob Alice Bob
69
Sending a secret message without previous key exchange
It works in theory, but not in cryptography The one which gets encrypted last is the first to get decrypted In cryptography the order is vital It did not work!!!! But...... It fed the inspiration.....
70
Merkle puzzles Problems that can be solved with some effort
Find the key of a symmetric cipher (ej. 32 bits) Puzzle(p) = E(p, “message”) Brute force attack 232 attempts at the most
71
Merkle puzzles Alice Bob prepare 232 puzzles
For each puzzle she chooses a random key pi (i= ) Puzzle i = E(pi, “Puzzle # ri” || ki) Keeps the 232 mappings (ri, ki) Sends all 232 puzzles to Bob Bob Chooses one puzzle at random an solves it (brute force) Get (rj, kj) Send rj to Alice Uses kj as a common key Alice: Prepare n puzzles 232 O(n) Bob: Solve one puzzle 232 O(n) Attacker: O(n2)
72
Functions Bidirectional Y = 2*X X = 2/Y Unidirectional
One way function Easy to do, but really hard to undo (impossible) Paint color mixing, break an egg, Lock Modular arithmetic
73
Modular and exponential arithmetic
We can solve it by trial and error If the results grows so does the x If the result is 81 and we test x=5 → 243, x is too big With normal arithmetic we can say if we are getting closer or not With modular arithmetic we CAN NOT 3x mod 7 x 3x 3xmod
74
Hellman-Diffie-Merckle
gx mod p p and g known by both ga mod p gb mod p (gb mod p)a mod p (ga mod p)b mod p gba mod p gab mod p In practice g is 2, 5 or 7. a, b y p need to be big
75
Hellman-Diffie-Merckle
? ga mod p gb mod p (gb mod p)a mod p (ga mod p)b mod p gba mod p gab mod p
76
Key exchange It was a giant step But it had some drawbacks
Alice y Bob have to be “on-line” simultaneously in order to exchange messages They kept on working In 1975 Diffie conceived a cypher with asymmetric key → two keys One to encrypt and a different to decrypt
77
Public key Two keys One of them has to be made public
The other, private. Only known by the owner A secure channel is not needed More computer power is needed 10,000 times slower than private key
78
Public key Both keys belong to the same “person”
Private Este es el texto original del mensaje en claro #$”%/&% *?¿[])(&”# []=()/&%¡ Este es el texto original del mensaje en claro Encrypt Decrypt Both keys belong to the same “person” The process can be made backwards
79
Confidentiality Alice Bob
80
Authentication Bob Alice
81
Public key Diffie y Hellman
Private key is impractical for actual applications. Too many keys P = D(KPRIV, E(KPUB, P)) Anyone can send a message but only the intended recipient will be able to read it P = D(KPUB, E(KPRIV, P)) Anyone can read the message but the recipient will know for sure it is from the intended sender It does not need so many keys as private key Based in hard problems
82
A lot more locks....... only one KEY!
Public Key Private Key
83
A lot more locks....... only one KEY!
84
A lot more locks....... only one KEY!
Private Key
85
A lot more locks....... only one KEY!
86
They invented the concept …..
The concept of the asymmetric key was revolutionary Diffie published the idea in 1975 and many scientists joined the cause .... But after a year nobody had found the elusive “one way function” Easy in one direction but almost impossible in the other (backwards) But easy backwards if someone has secret information (key)
87
Rivest-Shamir-Adleman
Rivest, Shamir y Adleman Shamir, Rivest y Adleman
88
RSA Invented by Ron Rivest, Adi Shamir and Leonard Adleman
Made public in 1978 It is the most used public key algorithm Uses the concept of “one way function” Easy to do in one direction but almos impossible to do in the other Select two very big primer numbers p y q Calculate N = p*q If N is 100 figures operations will be needed to factorize N p and q are the private key N is the public key
89
¿p and q given N? “Confía en el tiempo, que suele dar dulces salidas a muchas amargas dificultades” Miguel de Cervantes Saavedra N is at least 10308 1995. Pentium 100MHz 8MB RAM 50 to factorize 10130 With 100,000,000 computers 15 seconds Quantum processors Reading: “15 = 3*5 in half the time”
90
RSA Select two very big prime numbers p y q Public key N = pq
Private key d d*e = 1 mod (p-1)(q-1) Linear Congruence Equation d is calculated by means of Euclidean Algorithm C = Pe mod n P = Cd mod n
91
Linear Congruence Equation
ax ≡ b mod n It is solvable iif x ↔ b is divisible by the Greater Common Divisor gcd(a,n) Solvable by the Euclidean algorithm to find relative prime numbers
92
RSA example Alice choses two big and secret prime numbers p = 17
q = 11 Alice generates N = pq = 187 y chooses another number e N = 187 e = 7 e y (p-1)*(q-1) must be relative prime numbers Alice publishes N and e (her public key) C = Pe mod n
93
RSA example Bob wants to send a message ('x', ascii 88) P = 88
C = 887 mod 187 = 11 887 mod 187 = (884 mod 187)(882 mod 187)(881 mod 187) One way function, exponential with modular arithmetic Ciphertext (11) is sent through unsecure channel Alice receives 11
94
RSA example Alice receives 11 Calculate d using Euclidean algorithm
e*d = 1 mod (p-1)(q-1) 7*d = 1 mod 16*10 7*d = 1 mod 160 7*d = 161 d = 23 P = Cd mod n P = 1123 mod 187 P = 88 → 'x'
95
Comparison PRIVATE KEY 1 key Key must be kept secret
The most used to keep confifentiality and integrity of data The distribution of the key has to be made by other channel Fast PUBLIC KEY 2 keys One secret, the other has to be ade public Applied in key exchange and authentication Distribution is open Slow (10,000 times slower than private key) WHY????
96
Key exchange K is key to exchange S Sender, R Receiver
S sends CS = E(KPRIV-S, K) to R In R D(KPUB-S, CS) and it gets K Anyone hearing and has KPUB-S can obtain K S sends E(KPUB-R, K) to R Only R can decrypt and obtain K D(KPRIV-R, K) Problem: R cannot be sure the comes from S
97
Key exchange
98
“Digest” Hashing algorithms SHA-1, SHA-2, SHA-3 Secure Hash Algorithm
Developed by NIST Any length input (file) 160 bits output MD2, MD4, MD5 MD5 developed by Ronald Rivest Released in 1991 128 bits output
99
Digital signatures Sender Generates a digest of the message
Encrypt the digest using sender private key Send the original message in plaintext and the encrypted cipher Receiver Decrypt the digest with the sender public key Generates another digest with the plaintext Compares both digests to see if the message is valid
100
Digital signature Wikipedia
101
Digital Signatures Authenticates the source of the message
The message did not change in transit Non repudiation and integrity It does not assure confidenciality Types HMAC (Hashed Message Authentication Code) DSA (Digital Signature Algorithm) DSS (Digital Signature Standard) Used by the USA government
102
Digital Certificates SELF STUDY!!!
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.