Download presentation
Presentation is loading. Please wait.
Published byFelicity Russell Modified over 8 years ago
1
Lecture 2 Cryptology
2
Network Security(2012-2013) user name for students :guestnws pwd : guestnws2012 E-learning
3
Cryptology, the study of cryptosystems can be subdivided into two disciplines: Cryptography cryptanalysis Cryptography : concerns itself with the design of cryptosystems Cryptanalysis: (code breaking) studies the breaking of cryptosystems Cryptology
4
crypt— comes from the Greek word kryptos, meaning hidden or secret. Cryptography
5
Cryptography History DAVID KAHN at 1976 said at “coder breaker” : Cryptology was born among the Arabs. They were the first to discover and write down the methods of cryptanalysis وقد نشر مجمع اللغة العربية ، بدمشق الجزء الأول من الكتاب ” علم التعمية و استخراج المعمى ” ، سنة ١٩٨٧ ونشر الجزء الثاني سنة ١٩٩ 7 للدكتور : محمد مراياتي ويحيى ميرعلم و محمد حسان الطيان
6
About 1900 BC An Egyptian scribe used non-standard hieroglyphs in an inscription. Julius Caesar (100-44 BC) used a simple substitution with the normal alphabet (just shifting the letters a fixed amount) in government communications History
7
1933-1945 The Enigma machine was not a commercial success but it was taken over and improved upon to become the cryptographic workhorse of Nazi Germany. rotor cipher machines used for the encryption and decryption of secret messages. Enigma was invented by German engineer Arthur Scherbius at the end of World War I History
8
1976 A design by IBM based on the Lucifer cipher and with changes (including both S-box improvements and reduction of key size) by the US NSA, was chosen to be the U.S. Data Encryption Standard. History
9
1976 Whitfield Diffie and Martin Hellman published ``New Directions in Cryptography'', introducing the idea of public key cryptography History
10
Cryptography
11
Cryptography or Encryption Encryption, process of converting messages, information, or data into a form unreadable by anyone except the intended recipient. Encrypted data must be deciphered, or decrypted, before it can be read by the recipient. Cryptography
12
two requirements for secure use of symmetric encryption: a strong encryption algorithm a secret key known only to sender / receiver mathematically have: Y = E K (X) X = D K (Y) assume encryption algorithm is known implies a secure channel to distribute key 12 Cryptography : Requirements
13
plaintext - original message ciphertext - coded message cipher-algorithm : for transforming plaintext to ciphertext key - info used in cipher known only to sender/receiver encipher (encrypt) - converting plaintext to ciphertext decipher (decrypt) - recovering ciphertext from plaintext 13 Cryptography :Some Basic Terminology
14
Cryptanalysis
15
objective to recover key not just message is the art and science of analyzing information systems in order to study the hidden aspects of the systemsinformation systems general approaches: ◦ cryptanalytic attack rely on the nature of the algorithm plus perhaps some knowledge of the general characteristics of the plaintext or even some sample plaintext- ciphertext pairs. ◦ Brute-force attack try every possible key on a piece of cipher text until an intelligible translation into plaintext is obtained. 15 Cryptanalysis
16
ciphertext only only knows algorithm & ciphertext 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 16 Cryptanalytic Attacks
17
always possible to simply try every key most basic attack, proportional to key size assume either know / recognise plaintext 17 Brute Force Search Key Size (bits)Number of Alternative Keys Time required at 1 decryption/µs Time required at 10 6 decryptions/µs 322 32 = 4.3 10 9 2 31 µs= 35.8 minutes2.15 milliseconds 562 56 = 7.2 10 16 2 55 µs= 1142 years10.01 hours 1282 128 = 3.4 10 38 2 127 µs= 5.4 10 24 years 5.4 10 18 years 1682 168 = 3.7 10 50 2 167 µs= 5.9 10 36 years 5.9 10 30 years 26 characters (permutation) 26! = 4 10 26 2 10 26 µs= 6.4 10 12 years 6.4 10 6 years
18
Classic techniques
19
Substitution Transposition 19 Cryptography : The main two basic techniques
20
Substitution : where letters of plaintext are replaced by other letters or by numbers or symbols or if plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with cipher text bit patterns 20 Classical Substitution Ciphers
21
Transposition or Permutation ciphers : these hide the message by rearranging the letter order without altering the actual letters used can recognise these since have the same frequency distribution as the original text. 21 Transposition Ciphers
22
Example for Substitution
23
earliest known substitution cipher by Julius Caesar first attested use in military affairs replaces each letter by 3rd letter on example: Me e t m e a f t e r t h e t o g a p a r t y P H H W P H D I W H U W K H W R J D S D U W B 23 Caesar Cipher
24
then have Caesar cipher as: c = E(p) = (p + k) mod (26) p = D(c) = (c – k) mod (26) 24 Caesar Cipher
25
can define transformation as: 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 mathematically give each letter a number 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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 then have Caesar cipher as: c = E(p) = (p + 3) mod (26) If p= a= 0, E(a) = (0+3) mod 26 = 3 = D 25 Caesar Cipher
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 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 abcdefghijklmnopqrstuvwxyz 012345678910111213141516171819202122232425
27
Let k= 10 Encrypt the following “Hello” 27 Caesar Example
28
Let k= 10 Encrypt the following “Hello” H E L L O 7 4 11 11 14 17 14 21 21 24 -----------------------(MOD 26) 17 14 21 21 24 R O V V Y 28 Caesar Example
29
Let k= 9 Encrypt the following “SUN” 29 Caesar Example
30
Let k= 9 Encrypt the following “SUN” S U N 18 20 13 27 29 22 -----------------------(MOD 26) 1 3 22 B D W 30 Caesar Example
31
Let the cipher text = “IFMMP” and k =1 What is the plain text? P= (C-1) mod 26 P = Hello 31 Caesar Example
32
only have 26 possible ciphers ◦ A maps to A,B,..Z could simply try each in turn a brute force search given ciphertext, just try all shifts of letters do need to recognize when have plaintext eg. break ciphertext "GCUA VQ DTGCM" 32 Cryptanalysis of Caesar Cipher
33
GCUAVQDTGCM AWOUPKXNAWG BXPVQLYOBXH CYQWRMZPCYI DZRXSNAQDZJ EASYTOBREAK FBTZUPCSFBL GCUAVQDTGCM HDVBWREUHD IEWCXSFVIE JFXDYT gWJF KIYEZU hX LJZFAV IY MKAGBW jZ NLBH X kA OMc I y lB PN dJ z mC QO eK a nD R p f l b oE S q g m c pF T r h n d qG U s I o e rH V t j p f sI W u k q g tJ X v l r h uK Y w m s I vL Z x n t j wM 33 Example for fun
34
GCUAVQDTGCM AWOUPKXNAWG BXPVQLYOBXH CYQWRMZPCYI DZRXSNAQDZJ EASYTOBREAK FBTZUPCSFBL GCUAVQDTGCM HDVBWREUHD IEWCXSFVIE JFXDYT gWJF KIYEZU hX LJZFAV IY MKAGBW jZ NLBH X kA OMc I y lB PN dJ z mC QO eK a nD R p f l b oE S q g m c pF T r h n d qG U s I o e rH V t j p f sI W u k q g tJ X v l r h uK Y w m s I vL Z x n t j wM 34 Example for fun
35
Example of Transposition Ciphers 35
36
write message letters out diagonally over a number of rows then read off cipher row by row eg. write message out as: m e m a t r h t g p r y e t e f e t e o a a t giving ciphertext MEMATRHTGPRYETEFETEOAAT 36 Rail Fence cipher
37
a more complex transposition write letters of message out in rows over a specified number of columns (key length) Then reorder the columns according to some key before reading off the rows Key : 41532 Plain text : the simplest possible transpositions. 37 Row Transposition Ciphers
38
Make the statement in 5 columns: “the simplest possible transpositions” 38 Row Transposition Ciphers 12345 THESI MPLES TPOSS IBLET RANSP OSITI ONSXX
39
39 Row Transposition Ciphers 12345 THESI MPLES TPOSS IBLET RANSP OSITI ONSXX 41532 STIEH EMSLP STSOP EITLB SRPNA TOIIS XOXSN
40
Make the statement in 5 columns: 40 Row Transposition Ciphers Key: 41532 Cipher: STIEH EMSLP STSOP EITLB SRPNA TOIIS XOXSN 41532 STIEH EMSLP STSOP EITLB SRPNA TOIIS XOXSN
41
12345 THESI MPLES TPOSS IBLET RANSP OSITI ONSXX 41 The same plain with another key 15342 TIESH MSLEP TSOSP ITLEB RPNSA OIITS OXSXN The key : 15342 The cipher is :TIESH MSLEP TSOSP ITLEB RPNSA OIITS OXSXN
42
Plain text : " laser beams can be modulated to carry more intelligence than radio” Key is: 6 3 4 1 2 5 7 42 Row transposition : Example 1
43
" laser beams can be modulated to carry more intelligence than radio” 43 Row transposition : Example 1 7654321 EBRESAL BNACSMA ALUDOME ACOTDET EROMYRR ILLETNI HTECNEG OIDARNA
44
KEY : 6 3 4 1 2 5 7 44 Row transposition : Example 1 7654321 EBRESAL BNACSMA ALUDOME ACOTDET EROMYRR ILLETNI HTECNEG OIDARNA 7521436 ERALESB BAMACSN AUMEDOL AOETTDC EORRMYR ILNIETL HEEGCNT ODNAARI
45
Solution is : “bselare nscamab lodemua cdtteoa rymrroe lteinli tncg eeh iraando” 45 Row transposition : Example 1 7521436 ERALESB BAMACSN AUMEDOL AOETTDC EORRMYR ILNIETL HEEGCNT ODNAARI
46
Let key : COMPUTER PLAIN: “a convenient way to express the permutation “ 46 Another Example: 2
47
Let key : COMPUTER Key will be: 47 Another Example COMPUTER 14358726
48
48 Another Example Key: 14358726 Plain: a convenient way to the permutation Cipher: ANOVINCE EW TAOTNY TPEEUMHR TITOXXAN 12345678 ACONVENI ENTWAYTO THEPERMU TATIONXX 14358726 ANOVINCE EWTAOTNY TPEEUMHR TITOXXAN
49
consists of: writing the message out in rows reading off the message by reordering columns 49 Decryption of a Row Transposition cipher
50
CIPHER TEXT : LHEL VOEE BRYOXDYX THE solution : hello every body 50 4213 LEHL EEOV OYRB XYDX
51
Cipher text = OANTTOSRGINCHRPE Key: K=IVAN 51 Decryption of a Row Transposition cipher example:
52
The solution is : not a strong cipher 52
53
Modern Cryptographic Techniques 53
54
Modern cipher system : Symmetric Asymmetric Symmetric cryptography: Stream cipher Block cipher 54 Modern Cryptographic Techniques
55
Symmetric cipher Asymmetric cipher 55 Cryptography : Cryptography types or number of Keys
56
or conventional / private-key / single-key sender and recipient share a common key all classical encryption algorithms are private-key was only type prior to invention of public-key in 1970’s and by far most widely used 56 Symmetric Encryption
57
Symmetric cryptography : ◦ Also called Secret Key Cryptography (SKC): Uses a single key for both encryption and decryption Plain TextCipher Text Plain Text
58
Asymmetric Encryption probably most significant advance in the 3000 year history of cryptography uses two keys – a public & a private key asymmetric since parties are not equal uses clever application of number theoretic concepts to function complements rather than replaces private key crypto
59
Asymmetric Cryptography : ◦ Also called Public Key Cryptography (PKC): Uses one key for encryption and another for decryption Cipher TextPlain Text
60
60 Cryptography : Encryption Diagram Encryption algorithm Decryption algorithm Plain Text Cipher Text Key
61
Stream ciphers: where plaintext bits are combined with a pseudorandom cipher bit stream (key stream), typically by an exclusive-or (xor) operation. In a stream cipher, the plaintext digits are encrypted one at a time, and the transformation of successive digits varies during the encryption. 61 Stream cipher
62
62 Stream cipher Stream ciphers:- process messages a bit or byte at a time when en/decrypting
63
2 types: Synchronous stream Asynchronous stream Synchronous stream ciphers where the key stream depends only on the key, Asynchronous stream ones where the key stream also depends on the ciphertext. 63 Stream cipher
64
64 Stream cipher
65
Definition Stream Cipher Encryption and Decryption The plaintext, the ciphertext and the key stream consist of individual bits, i.e., xi,yi, si ∈ {0,1}. Encryption: y i = e si (x i ) ≡ x i +s i mod 2. Decryption: x i = d si (y i ) ≡ y i +s i mod 2. 65 Stream cipher
66
look at modern block ciphers one of the most widely used types of cryptographic algorithms provide secrecy /authentication services focus on DES (Data Encryption Standard) to illustrate block cipher design principles 66 Modern Block Ciphers
67
67 Block cipher Block cipher scheme :encrypts one block of data at a time using the same key on each block. In general, the same plaintext block will always be encrypted to the same cipher text if using the same key in a block cipher whereas the same plaintext will be encrypted to different cipher text in a stream cipher.
68
block ciphers: process messages in blocks, each of which is then en/decrypted like a substitution on very big characters 64-bits or more 68 Block cipher
69
Electronic Codebook (ECB) mode Cipher Block Chaining (CBC) mode Cipher Feedback (CFB) Output Feedback (OFB) mode 69 Block modes
70
Electronic Codebook (ECB) mode: The simplicity of the encryption modes is the electronic codebook (ECB) mode, in which the message is split into blocks and each is encrypted separately 70 Block modes
71
71 Block modes
72
Cipher Block Chaining (CBC) mode In the cipher-block chaining (CBC) mode, each block of the plaintext is XORed with the previous cipher text block before being encrypted. This way, each cipher text block is dependent on all plaintext blocks up to that point. 72 Block modes
73
73 Block modes
74
74 Block modes
75
Cipher Block Chaining (CBC) mode 75 Block modes
76
Cipher Feedback (CFB) Cipher feedback mode converts the block cipher into a stream cipher: they generate key-stream blocks, which then are XORed with the plaintext blocks to get the cipher-text. Just as with other stream ciphers, flipping a bit in the cipher-text produces a flipped bit in the plaintext at the same location. With cipher feedback, a key-stream block is computed by encrypting the previous cipher-text block. 76 Block modes
77
77 Block modes
78
78 Block modes
79
Cipher Feedback (CFB) 79 Block modes
80
Output Feedback (OFB) mode OFB is similar to CFB but with small differences, where the Output feedback generates the next key- stream block by encrypting the last one. 80 Block modes
81
81 Block modes
82
82 Block modes
83
Output Feedback (OFB) mode 83 Block modes
84
many current ciphers are block ciphers broader range of applications 84 Block vs Stream Ciphers
85
Block ciphers work a on block / word at a time, which is some number of bits. All of these bits have to be available before the block can be processed. Stream ciphers work on a bit or byte of the message at a time, hence process it as a “stream”. Block ciphers are currently better analysed, and seem to have a broader range of applications, hence focus on them. 85 Block vs Stream Ciphers
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.