3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security.

Slides:



Advertisements
Similar presentations
DES The Data Encryption Standard (DES) is a classic symmetric block cipher algorithm. DES was developed in the 1970’s as a US government standard The block.
Advertisements

Block Cipher Modes of Operation and Stream Ciphers
ECE454/CS594 Computer and Network Security
“Advanced Encryption Standard” & “Modes of Operation”
Encipherment Using Modern Symmetric-Key Ciphers. 8.2 Objectives ❏ To show how modern standard ciphers, such as DES or AES, can be used to encipher long.
Modern Symmetric-Key Ciphers
Modern Symmetric-Key Ciphers
Modern Symmetric-Key Ciphers
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Cryptography and Network Security Chapter 6 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 6. Chapter 6 – Block Cipher Operation Many savages at the present day regard their names as vital parts of themselves,
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
1 Overview of the DES A block cipher: –encrypts blocks of 64 bits using a 64 bit key –outputs 64 bits of ciphertext A product cipher –basic unit is the.
Modes of Operation CS 795. Electronic Code Book (ECB) Each block of the message is encrypted with the same secret key Problems: If two identical blocks.
RC4 1 RC4 RC4 2 RC4  Invented by Ron Rivest o “RC” is “Ron’s Code” or “Rivest Cipher”  A stream cipher  Generate keystream byte at a step o Efficient.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Chapter 3 – Block Ciphers and the Data Encryption Standard Jen-Chang Liu, 2004 Adopted from lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 6
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
Lecture 23 Symmetric Encryption
Chapter 2 (D) – Contemporary Symmetric Ciphers "I am fairly familiar with all the forms of secret writings, and am myself the author of a trifling monograph.
CSE 651: Introduction to Network Security
Lecture 3: Cryptographic Tools modified from slides of Lawrie Brown.
Block Cipher Transmission Modes CSCI 5857: Encoding and Encryption.
Modes of Operation. Topics  Overview of Modes of Operation  EBC, CBC, CFB, OFB, CTR  Notes and Remarks on each modes.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
Slide 1 Stream Ciphers uBlock ciphers generate ciphertext Ciphertext(Key,Message)=Message  Key Key must be a random bit sequence as long as message uIdea:
Chapter 20 Symmetric Encryption and Message Confidentiality.
Lecture 4: Using Block Ciphers
Chapter 20 Symmetric Encryption and Message Confidentiality.
Cryptography and Network Security
Stream Cipher July 2011.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
Chapter 9: Algorithms Types and Modes Dulal C. Kar Based on Schneier.
More About DES Cryptography and Network Security Reference: Sec 3.1 of Stallings Text.
Chapter 2 (B) – Block Ciphers and Data Encryption Standard.
1.1 Chapter 8 Encipherment Using Modern Symmetric-Key Ciphers Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Shambhu Upadhyaya Security – AES-CCMP Shambhu Upadhyaya Wireless Network Security CSE 566 (Lecture 13)
Modes of Operation INSTRUCTOR: DANIA ALOMAR. Modes of Operation A block cipher can be used in various methods for data encryption and decryption; these.
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 3 Read sections first (skipping 3.2.2)
Data Security and Encryption (CSE348) 1. Lecture # 13 2.
Cryptography and Network Security Chapter 6 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Presented by: Dr. Munam Ali Shah
Lecture 23 Symmetric Encryption
Privacy and Integrity: “ Two Essences of Network Security” Presenter Prosanta Gope Advisor Tzonelih Hwang Quantum Information and Network Security Lab,
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 2 Chapter 3 (sections ) You may skip proofs, but are.
Cryptography and Network Security
Cipher Transmission and Storage Modes Part 2: Stream Cipher Modes CSCI 5857: Encoding and Encryption.
1 CPCS425: Information Security (Topic 5) Topic 5  Symmetrical Cryptography  Understand the principles of modern symmetric (conventional) cryptography.
Block Cipher Modes Last Updated: Aug 25, ECB Mode Electronic Code Book Divide the plaintext into fixed-size blocks Encrypt/Decrypt each block independently.
Modes of Operation block ciphers encrypt fixed size blocks – eg. DES encrypts 64-bit blocks with 56-bit key need some way to en/decrypt arbitrary amounts.
Block Cipher Encrypting a large message Electronic Code Book (ECB) message m1 m2 m3 m4 m5 m6 c1 c2 c3 c4 c5 c6 E E E Secret.
Modes of Operation.
Chapter6: More on Symmetric Ciphers
Algorithm Modes ECB, CBC, CFB, OFB.
Computer and Network Security
(Data Encryption Standard)
Block Cipher Modes CS 465 Make a chart for the mode comparisons
Cryptography and Network Security
Algorithm Types & Algorithm Modes
Symmetric-Key Encryption
Block vs Stream Ciphers
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Chapter -3 ADVANCED ENCRYPTION STANDARD & BLOCK CIPHER OPERATION
Counter Mode, Output Feedback Mode
Elect. Codebook, Cipher Block Chaining
Secret-Key Encryption
Presentation transcript:

3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security

Abstract We will discuss –2DES and 3DES –AES (Advanced Encryption Standard) –How to use block ciphers? –RC4: a widely used stream cipher –Problems with WEP’s use of RC4 2

Multiple Encryption with DES DES is not secure enough. The once large key space, 2 56, is now too small. In 2001, NIST published the Advanced Encryption Standard (AES) as an alternative. But users in commerce and finance are not ready to give up on DES. Solution: to use multiple DES with multiple keys 3

Double-DES Consider 2-DES with two keys: C = E K2 (E K1 (P)) Decryption: P = D K1 (D K2 (C)) Key length: 56 x 2 = 112 bits This should have thwarted brute-force attacks? Wrong! 4

Meet-in-the-Middle Attack on 2DES 2-DES: C = E K2 (E K1 (P)) So, X = E K1 (P) = D K2 (C) Given a known pair (P, C), attack as follows: –Encrypt P with all 2 56 possible keys for K1. –Decrypt C with all 2 56 possible keys for K2. –If E K1’ (P) = D K2’ (C), try the keys on another (P’, C’). –If works, (K1’, K2’) = (K1, K2) with high probability. –Takes O(2 56 ) steps; not much more than attacking 1-DES. 5

Triple DES with Two Keys A straightforward implementation would be: C = E K1 (E K2 (E K1 (P))) In practice: C = E K1 (D K2 (E K1 (P))) –Also referred to as EDE encryption Reason: if K1=K2, then 3DES = 1DES. Thus, a 3DES software can be used as a single-DES. Standardized in ANSI X9.17 & ISO8732 No current known practical attacks –What about the meet-in-the-middle attack? 6

Meet-in-the-Middle Attack on 3DES 1.For each possible key for K1, encrypt P to produce a possible value for A. 2.Using this A, and C, attack the 2DES to obtain a pair of keys (K2, K1’). 3.If K1’ = K1, try the key pair (K1, K2) on another (C’,P’). 4.If it works, (K1, K2) is the key pair with high probability. 5.It takes O(2 55 x 2 56 ) = O(2 111 ) steps on average. E D E A B P C K1 K2 K1 7

Triple DES with Three Keys Encryption: C = E K3 (D K2 (E K1 (P))). If K1 = K3, we have 3DES with 2 keys. If K1 = K2 = K3, we have the regular DES. So, 3DES w/ 3keys is backward compatible with 3DES w/ 2 keys and with the regular DES Some internet applications have adopted 3DES with three keys. –E.g. PGP and S/MIME. 8

Finite Fields Some mathematics used in AES

AES: Advanced Encryption Standard

20 AES: Advanced Encryption Standard In1997, NIST began the process of choosing a replacement for DES and called it the Advanced Encryption Standard. Requirements: block length of 128 bits, key lengths of 128, 192, and 256 bits. In 2000, Rijndael cipher (by Rijmen and Daemen) was selected. An iterated cipher, with 10, 12, or 14 rounds. Rijndael allows various block lengths. But AES allows only one block size: 128 bits.

22

23

24

25

26

27 Figure 5.1 AES Encryption and Decryption

28

29

30

31

32

33

34

35

Modes of Operations

How to use a block cipher? Block ciphers encrypt fixed size blocks –E.g. DES encrypts 64-bit blocks We need some way to encrypt arbitrary amounts of data –E.g. a message of 1000 bytes NIST defines five ways to do it –Called modes of operations –Including block and stream modes 37

Five Modes of Operation –Electronic codebook mode (ECB) –Cipher block chaining mode (CBC) – most popular –Output feedback mode (OFB) –Cipher feedback mode (CFB) –Counter mode (CTR) 38

Electronic Code Book (ECB) The plaintext is broken into blocks, P 1, P 2, P 3,... Each block is encrypted independently of the other blocks C i = E K (P i ) For a given key, this mode behaves like we have a gigantic codebook, in which each plaintext block has an entry, hence the name Electronic Code Book 39

Remarks on ECB Strength: it’s simple. Weakness: –Repetitive information contained in the plaintext may show in the ciphertext, if aligned with blocks. –If the same message (e.g., your SSN) is encrypted (with the same key) and sent twice, their ciphertexts are the same. Typical application: secure transmission of short pieces of information (e.g. an encryption key) 40

Cipher Block Chaining (CBC) 41

Cipher Block Chaining (CBC) 42

Remarks on CBC The same key is used for all blocks. A ciphertext block depends on all blocks before it. So, repeated plaintext blocks are encrypted differently. Initialization Vector (IV) –Must be known to both the sender & receiver –Typically, IV is either a fixed value –Or is sent encrypted in ECB mode before the rest of message. 43

Message Padding The last plaintext block may be short of a whole block and needs padding: Possible padding: –Known non-data values (e.g. nulls) –Or a number indicating the size of the pad –Or a number indicating the size of the plaintext –The last two schemes may require an extra block. 44

45 Cipher feedback mode (basic version) Plaintext blocks: p 1, p 2, … Key: k Basic idea: construct key stream k 1, k 2, k 3, … Encryption:

Cipher Feedback (CFB) Mode 46

Generating Key Stream for CFB 47

Encryption in CFB Mode 48

Decryption in CFB Mode 49

Remark on CFB The block cipher is used as a stream cipher. Appropriate when data arrives in bits/bytes. s can be any value; a common value is s = 8. A ciphertext segment depends on the current and all preceding plaintext segments. A corrupted ciphertext segment during transmission will affect the current and next several plaintext segments. –How many plaintext segments will be affected? 50

Output Feedback (OFB) Mode 51

Cipher Feedback Output Feedback 52

Remark on OFB The block cipher is used as a stream cipher. Appropriate when data arrives in bits/bytes. Advantage: –more resistant to transmission errors; a bit error in a ciphertext segment affects only the decryption of that segment. Disadvantage: –Cannot recover from lost ciphertext segments; if a ciphertext segment is lost, all following segments will be decrypted incorrectly. IV should be generated randomly each time and sent with the ciphertext. 53

Counter Mode (CTR) A counter T is initialized to some IV and then incremented by 1 for each subsequent plaintext block. Encryption: T 1 = IV T i = T i C i = P i XOR E K (T i ) 54

Remark on CTR Strengthes: –Needs only the encryption algorithm (so do CFB and OFB) –Fast encryption/decryption; blocks can be processed (encrypted or decrypted) in parallel; good for high speed links –Random access to encrypted data blocks As in OFB, IV should not be reused. 55

Stream Ciphers

Stream Cipher Diagram 57

Stream Ciphers 58

Stream Ciphers 59

The RC4 Stream Cipher Designed by Ron Rivest in 1987 for RSA Security. Kept as a trade secret until leaked out in The most popular stream cipher. Simple and fast. With a 128 bits key, the period is > Used in the SSL/TLS standards (for secure Web communication), IEEE wireless LAN standard, Microsoft Point-to-Point Encryption, and many others. 60

RC4 61

RC4: Initial Permutation 62

RC4: Key Stream Generation 63

Security of RC4 The keystream generated by RC4 is biased. –The second byte is biased toward zero with high probability. –The first few bytes are strongly non-random and leak information about the input key. Defense: discard the initial n bytes of the keystream. –Called “RC4-drop[n-bytes]”. –Recommended values for n = 256, 768, or 3072 bytes. Efforts are underway (e.g. the eSTREAM project) to develop more secure stream ciphers. 64

Problems with WEP’s use of RC4 WEP is a protocol using RC4 to encrypt packets for transmission over IEEE wireless LAN. WEP requires each packet to be encrypted with a separate RC4 key. The RC4 key for each packet is a concatenation of a 24-bit IV (initialization vector) and a 40 or 104-bit long- term key. 65 l RC4 key: IV (24) Long-term key (40 or 104 bits)

frames using WEP 66 l Header IV Packet ICV FCS encrypted ICV: integrity check value FCS: frame check sequence Both use CRC32

Fluhrer, Mantin, and Shamir showed that: If the same secret key is used with numerous IVs, and the attacker can obtain the first word of RC4 output (keystream) corresponding to each IV, then he can construct the secret key with little effort. The first word is known for many plaintext packets. Recall: Ciphertext = plaintext XOR keystream So, the first word of RC output (keystream) can be obtained. 67

Tews, Weinmann, and Pyshkin wrote an article, “Breaking 104 bit WEP in less than 60 seconds,” discussing how to discover the RC4 key by analyzing the easily identified ARP packets. ARP: Address Resolution Protocol. 68