Page 1 Page 1
Introduction to Cryptography
Paul Krzyzanowski pxk@cs.rutgers.edu
Distributed Systems
Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Distributed Systems Introduction to Cryptography Paul Krzyzanowski - - PowerPoint PPT Presentation
Distributed Systems Introduction to Cryptography Paul Krzyzanowski pxk@cs.rutgers.edu Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License. Page 1 Page 1 Ngywioggazhon
Page 1 Page 1
Paul Krzyzanowski pxk@cs.rutgers.edu
Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Page 2 Page 2
Page 3 Page 3
Page 4
A secret manner of writing, … Generally, the art of writing or solving ciphers. — Oxford English Dictionary
Page 5
1967 D. Kahn, Codebreakers p. xvi, Cryptology is the science that embraces cryptography and cryptanalysis, but the term ‘cryptology’ sometimes loosely designates the entire dual field of both rendering signals secure and extracting information from them. — Oxford English Dictionary
Page 6
Page 7
Page 8
Page 9
– HD DVD (Dec 2006) and Blu-Ray (Jan 2007) – RC4 – All digital cellular encryption algorithms – DVD and DIVX video compression – Firewire – Enigma cipher machine – Every NATO and Warsaw Pact algorithm during Cold War
Page 10
BTW, the above is a bump key. See http://en.wikipedia.org/wiki/Lock_bumping.
Page 11
Source: en.wikipedia.org/wiki/Pin_tumbler_lock
Page 12
Source: en.wikipedia.org/wiki/Pin_tumbler_lock
Page 13
– Strengths – Weaknesses
we can assess how much to trust the key & lock.
Source: en.wikipedia.org/wiki/Pin_tumbler_lock
Page 14
Page 15
Page 16
Page 17
Page 18
Example function:
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
Page 26 Page 26
Page 27 Page 27
Page 28
– Julius Caesar c. 60 BC – shift cipher: simple variant of a substitution cipher – each letter replaced by one n positions away modulo alphabet size n = shift value = key
– early Indians also used substitutions based on phonetics similar to pig latin
Page 29
Page 30
Page 31
Page 32
Page 33
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
Page 40
Page 41
Page 42
Page 43
Page 44
Page 45
Page 46
Page 47
Page 48
(1.2M chars) (55.8M chars)
Page 49
Page 50
letter and substitute
Page 51
Page 52
Page 53
Page 54
Page 55
Page 56
Page 57
Page 58
Page 59
Page 60
Page 61
Page 62
Page 63
Page 64
Page 65
Page 66
Page 67
"The rebels reposed their major trust, however, in the Vigenere, sometimes using it in the form of a brass cipher
South knew the cipher was unbreakable. In practice, it proved a dismal failure. For one thing, transmission errors that added or subtracted a letter ... unmeshed the key from the cipher and caused no end of difficulty. Once Major Cunningham of General Kirby-Smith's staff tried for twelve hours to decipher a garbled message; he finally gave up in disgust and galloped around the Union flank to the sender to find out what it said."
http://rz1.razorpoint.com/index.html
Page 68 Page 68
Page 69
Page 70
M H E
Page 71
Y A A
Page 72
C S S
Page 73
A F x Pad out the text. This is a block cipher versus a stream cipher
Page 74
T L y
Page 75
M Y C A T H A S F L E A S x y z MYCATHASFLEAS
Page 76
M Y C A T H A S F L E A S x y z MYCATHASFLEAS MTFS
Page 77
M Y C A T H A S F L E A S x y z MYCATHASFLEAS MTFSYHLx
Page 78
M Y C A T H A S F L E A S x y z MYCATHASFLEAS MTFSYHLxCAEy
Page 79
M Y C A T H A S F L E A S x y z MYCATHASFLEAS MTFSYHLxCAEyASAz
Page 80
M Y C A T H A S F L E A S x y z MYCATHASFLEAS
Page 81
M Y C A T H A S F L E A S x y z YHLx YHLx MYCATHASFLEAS
Page 82
M Y C A T H A S F L E A S x y z ASAz YHLxASAz MYCATHASFLEAS
Page 83
M Y C A T H A S F L E A S x y z MTFS YHLxASAzMTFS MYCATHASFLEAS
Page 84
M Y C A T H A S F L E A S x y z CAEy YHLxASAzMTFSCAEy MYCATHASFLEAS
Page 85
M Y C A T H A S F L E A S x y z YHLxASAzMTFSCAEY MYCATHASFLEAS
Page 86
Page 87 Page 87
Page 88
– set of independently rotating cylinders through which electrical pulses flow – each cylinder has input & output pin for each letter of the alphabet – implements a version of the Vigenère cipher – each rotor implements a substitution cipher – output of each rotor is fed into the next rotor
Page 89
– internal combinations shifted by one – polyalphabetic substitution cipher with a period of 26 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
Page 90
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 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 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 G V I L C M B Q F K D O S P Z H R E U Z N X A T W J 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 K H W J M D N C R G L E P T Q Z I S F V A O Y B U X
Page 91
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 MY CAT HAS FLEAS S
Page 92
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 MY CAT HAS FLEAS SU
Page 93
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 MY CAT HAS FLEAS SUI
Page 94
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 MY CAT HAS FLEAS SUIU
Page 95
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 MY CAT HAS FLEAS SUIUV
Page 96
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 MY CAT HAS FLEAS SUIUVA
Page 97
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 MY CAT HAS FLEAS SUIUVAY
Page 98
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 MY CAT HAS FLEAS SUIUVAYO
Page 99
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 MY CAT HAS FLEAS SUIUVAYOI
Page 100
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 MY CAT HAS FLEAS SUIUVAYOIN
Page 101
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 MY CAT HAS FLEAS SUIUVAYOINK
Page 102
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 MY CAT HAS FLEAS SUIUVAYOINKB
Page 103
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 MY CAT HAS FLEAS SUIUVAYOINKBY
Page 104
– substitution cipher with a period = length of alphabet (e.g., 26)
– feed output of one cylinder as input to the next one – first rotor advances after character is entered – second rotor advances after a full period of the first – polyalphabetic substitution cipher
Page 105
Germany during WWII
– 263 = 17,576 possible rotor positions
patch panel before sending to rotor engine
encryption symmetric
– setting was f(date) – find in book of codes
Page 106
Keyboard (input) Glowlamps (results) Plugboard
Page 107
– encryption is addition of characters modulo 26
Page 108
Page 109
Page 110
Page 111
void onetimepad(void) { FILE *if = fopen(“intext”, “r”); FILE *kf = fopen(“keytext”, “r”); FILE *of = fopen(“outtext”, “w”); int c, k; while ((c = getc(if)) != EOF) { k = getc(kf); putc((c^k), of); } fclose(if); fclose(kf); fclose(of); }
Page 112
Page 113
– John vonNeumann
– Linear feedback shift registers – Multiplicative lagged Fibonacci generators – Linear congruential generator
– Time between keystrokes – Various network/kernel events – Cosmic rays – Electrical noise – Other encrypted messages
Page 114 Page 114
Page 115
Page 116
64 bit plaintext block initial permutation, IP left half, L1 right half, R0
R1 = L0 f(R0, K1) L1= R0
16 rounds
L15= R14 R15 = L14 f(R14, K15)
48-bit subkey permuted from key
L16 = R15 R16 = L15 f(R15, K16)
final permutation, IP-1 64 bit ciphertext block
Page 117
DATA: right 32 bits KEY: 56 bits
DATA: left 32 bits New DATA: right 32 bits 48 bits 48 bits S S S S S S S S
Page 118
– 48-bit result moves to substitution operation via eight substitution boxes (s-boxes)
– 6-bit input – 4-bit output
Page 119
– DES cracker machines built to crack DES keys in a few hours – DES Deep Crack: 90 billion keys/second – Distributed.net: test 250 billion keys/second
Page 120
Page 121
Page 122
Page 123
Page 124
Page 125
– 1992 – 128-bit keys, operates on 8-byte blocks (like DES) – algorithm is more secure than DES
– 1995 – key size up to 2048 bits – not secure against multiple messages encrypted with the same key
– NIST proposed successor to DES, chosen in October 2000 – based on Rigndael cipher – 128, 192, and 256 bit keys
Page 126
http://csrc.nist.gov/encryption/aes/
Page 127 Page 127