Stream Cipher July 2011.

Slides:



Advertisements
Similar presentations
Block Cipher Modes of Operation and Stream Ciphers
Advertisements

ECE454/CS594 Computer and Network Security
“Advanced Encryption Standard” & “Modes of Operation”
CS470, A.SelcukStream Ciphers1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
Modern Symmetric-Key Ciphers
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
Encryption/Decyprtion using RC4 Vivek Ramachandran.
WEP 1 WEP WEP 2 WEP  WEP == Wired Equivalent Privacy  The stated goal of WEP is to make wireless LAN as secure as a wired LAN  According to Tanenbaum:
CS457 – Introduction to Information Systems Security Cryptography 1b Elias Athanasopoulos
Chalmers University of Technology Wireless security Breaking WEP and WPA.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
Stream cipher diagram + + Recall: One-time pad in Chap. 2.
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.
Wireless Security Presentation by Paul Petty and Sooner Brooks-Heath.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Chap. 6: Contemporary Symmetric Ciphers Jen-Chang Liu, 2004 Adapted from Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 6
Cryptography1 CPSC 3730 Cryptography Chapter 7 Confidentiality Using Symmetric Encryption.
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.
Computer Security CS 426 Lecture 3
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
CS526Topic 3: One-time Pad and Perfect Secrecy 1 Information Security CS 526 Topic 3 Cryptography: One-time Pad, Information Theoretic Security, and Stream.
RC4-Stream Ciphers Blowfish, RC5 Block Ciphers M. Sakalli, Marmara Univ. Chapter 6 of Cryptography and Network Security by William Stallings Modified from.
Wireless security & privacy Authors: M. Borsc and H. Shinde Source: IEEE International Conference on Personal Wireless Communications 2005 (ICPWC 2005),
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings.
Cryptography and Network Security (CS435)
Códigos y Criptografía Francisco Rodríguez Henríquez A Short Introduction to Stream Ciphers.
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:
COEN 350 Mobile Security. Wireless Security Wireless offers additional challenges: Physical media can easily be sniffed. War Driving Legal? U.S. federal.
One-Time Pad Or Vernam Cipher Sayed Mahdi Mohammad Hasanzadeh Spring 2004.
CS555Spring 2012/Topic 51 Cryptography CS 555 Topic 5: Pseudorandomness and Stream Ciphers.
Information Security Lab. Dept. of Computer Engineering 182/203 PART I Symmetric Ciphers CHAPTER 7 Confidentiality Using Symmetric Encryption 7.1 Placement.
Stream Ciphers Making the one-time pad practical.
WEP AND WPA by Kunmun Garabadu. Wireless LAN Hot Spot : Hotspot is a readily available wireless connection.  Access Point : It serves as the communication.
3DES and Block Cipher Modes of Operation CSE 651: Introduction to Network Security.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 3 Read sections first (skipping 3.2.2)
Cryptography and Network Security Contemporary Symmetric Ciphers.
Wired Equivalent Privacy (WEP): The first ‘confidentiality’ algorithm for the wireless IEEE standard. PRESENTED BY: Samuel Grush and Barry Preston.
Data Security and Encryption (CSE348) 1. Lecture # 14 2.
Symmetric Encryption IT 352 : Lecture 2- part2 Najwa AlGhamdi, MSc – 2012 /1433.
無線網路安全 WEP. Requirements of Network Security Information Security Confidentiality Integrity Availability Non-repudiation Attack defense Passive Attack.
Security Technologies built into std. Presented by T.R.Santhosh.
Presented by: Dr. Munam Ali Shah
Lecture 23 Symmetric Encryption
1 Symmetric-Key Encryption CSE 5351: Introduction to Cryptography Reading assignment: Chapter 2 Chapter 3 (sections ) You may skip proofs, but are.
Applied Cryptography (Symmetric) Part I. Many savages at the present day regard their names as vital parts of themselves, and therefore take great pains.
Dr. Lo’ai Tawalbeh summer 2007 Chapter 6: Contemporary Symmetric Ciphers Dr. Lo’ai Tawalbeh New York Institute of Technology (NYIT) Jordan’s Campus INCS.
Cryptography and Network Security Chapter 7 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
IEEE Security Specifically WEP, WPA, and WPA2 Brett Boge, Presenter CS 450/650 University of Nevada, Reno.
Wired Equivalent Privacy (WEP) Chris Overcash. Contents What is WEP? What is WEP? How is it implemented? How is it implemented? Why is it insecure? Why.
University of Malawi, Chancellor College
WLAN Security1 Security of WLAN Máté Szalay
Slide 1 Vitaly Shmatikov CS 378 Stream Ciphers. slide 2 Stream Ciphers uRemember one-time pad? Ciphertext(Key,Message)=Message  Key Key must be a random.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
Chapter6: More on Symmetric Ciphers
Unit -1.
Stream Cipher.
Pseudo Random Number Generators
CSE 4905 WiFi Security I WEP (Wired Equivalent Privacy)
Symmetric-Key Encryption
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
RC4 RC
Chapter -4 STREAM CIPHERS
The RC4 Algorithm Network Security.
Stream Cipher Structure
By: Anthony Gervasi & Adam Dickinson
Presentation transcript:

Stream Cipher July 2011

Topics One-Time-Pad Random Number Generator Stream Cipher RC4 RC4 and WEP

One-Time Pad Developed by Gilbert Vernam in 1918, another name: Vernam Cipher The key a truly random sequence of 0’s and 1’s the same length as the message use one time only The encryption adding the key to the message modulo 2, bit by bit. Encryption Decryption mi : plain-text bits. ki : key (key-stream ) bits ci : cipher-text bits.

Example Encryption: 1001001 1000110 plaintext 1010110 0110001 key 0011111 1110110 ciphertext Decryption: 0011111 1110110 ciphertext 1001001 1000110 plaintext

One-Time pad practical Problem Key-stream should be as long as plain-text Difficult in Key distribution & Management Solution : Stream Ciphers Key-stream is generated in pseudo-random fashion form Relatively short secret key

Stream Cipher Model Output function appears random Si+1 Si Si : state of the cipher at time t = i. F : state function. G : output function. F G Initial state, output and state functions are controlled by the secret key. ki mi ci

Random Numbers In all cases its critical that these values be Many uses of random numbers in cryptography Nonce as Initialize Vector Session keys Public key generation Keystream for a one-time pad In all cases its critical that these values be statistically random, uniform distribution, independent unpredictability of future values from previous values Care needed with generated random numbers Random numbers play an important role in the use of encryption for various network security applications. In this section, we provide a brief overview of the use of random numbers in cryptography and network security and then focus on the principles of pseudorandom number generation. Getting good random numbers is important, but difficult. You don't want someone guessing the key you're using to protect your communications because your "random numbers" weren't (as happened in an early release of Netscape SSL). Traditionally, the concern in the generation of a sequence of allegedly random numbers has been that the sequence of numbers be random in some well-defined statistical sense (with uniform distribution & independent). In applications such as reciprocal authentication, session key generation, and stream ciphers, the requirement is not just that the sequence of numbers be statistically random but that the successive members of the sequence are unpredictable (so that it is not possible to predict future values having observed previous values). With "true" random sequences, each number is statistically independent of other numbers in the sequence and therefore unpredictable. However, as is discussed shortly, true random numbers are seldom used; rather, sequences of numbers that appear to be random are generated by some algorithm.

Topics One-Time-Pad Random Number Generator Stream Cipher RC4 RC4 and WEP

Pseudorandom Number Generators (PRNGs) Often use deterministic algorithmic techniques to create “random numbers” although are not truly random can pass many tests of “randomness” Known as “Pseudorandom Numbers” Created by “Pseudorandom Number Generators (PRNGs)”

Random & Pseudorandom Number Generators Stallings Figure 7.1 contrasts a true random number generator (TRNG) with two forms of pseudorandom number generators. A TRNG takes as input a source that is effectively random; the source is often referred to as an entropy source. In contrast, a PRNG takes as input a fixed value, called the seed, and produces a sequence of output bits using a deterministic algorithm. Typically, as shown, there is some feedback path by which some of the results of the algorithm are fed back as input as additional output bits are produced. The important thing to note is that the output bit stream is determined solely by the input value or values, so that an adversary who knows the algorithm and the seed can reproduce the entire bit stream. Figure 7.1 shows two different forms of PRNGs, based on application; • Pseudorandom number generator: An algorithm that is used to produce an open-ended sequence of bits is referred to as a PRNG. A common application for an open-ended sequence of bits is as input to a symmetric stream cipher, as discussed in Section 7.4. Also, see Figure 3.1a. • Pseudorandom function (PRF): A PRF is used to produced a pseudorandom string of bits of some fixed length. Examples are the symmetric encryption keys and nonces. Typically, the PRF takes as input a seed plus some context specific values, such as a user ID or an application ID.

PRNG Requirements Randomness Unpredictability uniformity, scalability, consistency Unpredictability forward & backward Unpredictability use same tests to check Characteristics of the seed Secure if known adversary can determine output so must be random or pseudorandom number

Using Block Ciphers as PRNGs For cryptographic applications, can use a block cipher to generate random numbers Often for creating session keys from master key CTR Xi = EK[Vi] OFB Xi = EK[Xi-1] A popular approach to PRNG construction is to use a symmetric block cipher as the heart of the PRNG mechanism. For any block of plaintext, a symmetric block cipher produces an output block that is apparently random. That is, there are no patterns or regularities in the ciphertext that provide information that can be used to deduce the plaintext. Thus, a symmetric block cipher is a good candidate for building a pseudorandom number generator. If an established, standardized block cipher is used, such as DES or AES, then the security characteristics of the PRNG can be established. Further, many applications already make use of DES or AES, so the inclusion of the block cipher as part of the PRNG algorithm is straightforward. Two approaches that use a block cipher to build a PNRG have gained widespread acceptance: the CTR mode and the OFB mode. The CTR mode is recommended in SP 800-90, in the ANSI standard X9.82 (Random Number Generation), and RFC 4086. The OFB mode is recommended in X9.82 and RFC 4086. Stallings Figure 7.3 illustrates the two methods. In each case, the seed consists of two parts: the encryption key value and a value V that will be updated after each block of pseudorandom numbers is generated. In the CTR case, the value of V is incremented by 1 after each encryption. In the case of OFV, the value of V is updated to equal the value of the preceding PRNG block. In both cases, pseudorandom bits are produced on block at a time.

Stream Ciphers Generalization of one-time pad Stream cipher is initialized with short key Key is “stretched” into long keystream have a pseudo random property Keystream is used like a one-time pad XOR to encrypt or decrypt A typical stream cipher encrypts plaintext one byte at a time, although a stream cipher may be designed to operate on one bit at a time or on units larger than a byte at a time. In a stream cipher, a key is input to a pseudorandom bit generator that produces a stream of 8-bit numbers that are apparently random. The output of the generator, called a keystream, is combined one byte at a time with the plaintext stream using the bitwise exclusive-OR (XOR) operation. The stream cipher is similar to the one-time pad discussed in Chapter 2. The difference is that a one-time pad uses a genuine random number stream, whereas a stream cipher uses a pseudorandom number stream. But rely on the randomness of stream key completely destroys statistically properties in message. However, you must never reuse a stream key since otherwise you can recover messages (as with a book cipher).

Topics One-Time-Pad Random Number Generator Stream Cipher RC4 RC4 and WEP

Stream Cipher Structure Randomness of stream key completely destroys statistically properties in message Must never reuse stream key otherwise can recover messages Stallings Figure 7.5 illustrates the general structure of a stream cipher, where a key is input to a pseudorandom bit generator that produces an apparently random keystream of bits, and which are XOR’d with message to encrypt it, and XOR’d again to decrypt it by the receiver. Encryption Using a secret key generate the RC4 keystream using the KSA and PRGA. Read the file and xor each byte of the file with the corresponding keystream byte. Write this encrypted output to a file. Transmit file over an insecure channel. Decryption Using the same secret key used to encrypt generate the RC4 keystream. Read the encrypted file and Xor every byte of this encrypted stream with the corresponding byte of the keystream. This will yield the original plaintext

Stream Cipher Properties Some design considerations are: long period with no repetitions statistically random depends on large enough key large linear complexity Properly designed, can be as secure as a block cipher with same size key Benefit : usually simpler & faster [KUMA97] lists the following important design considerations for a stream cipher: The encryption sequence should have a large period, the longer the period of repeat the more difficult it will be to do cryptanalysis. The keystream should approximate the properties of a true random number stream as close as possible, the more random-appearing the keystream is, the more randomized the ciphertext is, making cryptanalysis more difficult. To guard against brute-force attacks, the key needs to be sufficiently long. The same considerations as apply for block ciphers are valid here .Thus, with current technology, a key length of at least 128 bits is desirable. With a properly designed pseudorandom number generator, a stream cipher can be as secure as block cipher of comparable key length. The primary advantage of a stream cipher is that stream ciphers are almost always faster and use far less code than do block ciphers. A stream cipher can be constructed with any cryptographically strong PRNG.

Topics One-Time-Pad Random Number Generator Stream Cipher RC4 RC4 and WEP

RC4 Basics A symmetric key encryption algorithm invented by Ron Rivest A proprietary cipher owned by RSA, kept secret Code released at the sites of Cyberpunk remailers Variable key size, byte-oriented stream cipher Normally uses 64 bit and 128 bit key sizes. Used in SSL/TLS (Secure socket, transport layer security) between web browsers and servers, IEEE 802.11 wirelss LAN std: WEP (Wired Equivalent Privacy), WPA (WiFi Protocol Access) protocol RC4 is a stream cipher designed in 1987 by Ron Rivest for RSA Security. It is a variable key-size stream cipher with byte-oriented operations. The algorithm is based on the use of a random permutation. Analysis shows that the period of the cipher is overwhelmingly likely to be greater than 10^100. Eight to sixteen machine operations are required per output byte, and the cipher can be expected to run very quickly in software. RC4 is probably the most widely used stream cipher. It is used in the SSL/TLS secure web protocol, & in the WEP & WPA wireless LAN security protocols. RC4 was kept as a trade secret by RSA Security, but in September 1994 was anonymously posted on the Internet on the Cypherpunks anonymous remailers list. In brief, the RC4 key is ued to form a random permutation of all 8-bit values, it then uses that permutation to scramble input info processed a byte at a time.

RC4-based Usage WEP WPA default Bit Torrent Protocol Encryption Microsoft Point-to-Point Encryption SSL (optionally) SSH (optionally) Remote Desktop Protocol Kerberos (optionally)

RC4 Block Diagram Secret Key RC4 Keystream Encrypted Text Plain Text + Cryptographically very strong and easy to implement

RC4 …Inside KSA PRGA on the KSA Consists of 2 parts: Key Scheduling Algorithm (KSA) Pseudo-Random Generation Algorithm (PRGA) KSA Generate State array PRGA on the KSA Generate keystream XOR keystream with the data to generated encrypted stream KSA PRGA

The KSA Use the secret key to initialize and permutation of state vector S, done in two steps 1 2 for i = 0 to 255 do S[i] = i; T[i] = K[i mod(|K|)]); j = 0; for i = 0 to 255 do j = (j+S[i]+T[i])(mod 256) swap (S[i], S[j]) [S], S is set equal to the values from 0 to 255 S[0]=0, S[1]=1,…, S[255]=255 [T], A temporary vector [K], Array of bytes of secret key |K| = Keylen, Length of (K) Use T to produce initial permutation of S The only operation on S is a swap; S still contains number from 0 to 255 After KSA, the input key and the temporary vector T will be no longer used

The PRGA Generate key stream k , one by one XOR S[k] with next byte of message to encrypt/decrypt i = j = 0; While (more_byte_to_encrypt) i = (i + 1) (mod 256); j = (j + S[i]) (mod 256); swap(S[i], S[j]); k = (S[i] + S[j]) (mod 256); Ci = Mi XOR S[k]; Sum of shuffled pair selects "stream key" value from permutation

RC4 Lookup Stage The output byte is selected by looking up the values of S[i] and S[j], adding them together modulo 256, and then looking up the sum in S S [S[i] + S[j]] is used as a byte of the key stream, K i = j = 0; While (more_byte_to_encrypt) i = (i + 1) (mod 256); j = (j + S[i]) (mod 256); swap(S[i], S[j]); k = (S[i] + S[j]) (mod 256); Ci = Mi XOR S[k]; http://en.wikipedia.org/wiki/File:RC4.svg

Detailed Diagram

Overall Operation of RC4

Decryption using RC4 Use the same secret key as during the encryption phase. Generate keystream by running the KSA and PRGA. XOR keystream with the encrypted text to generate the plain text. Logic is simple : (A xor B) xor B = A A = Plain Text or Data B = KeyStream

Topics One-Time-Pad Random Number Generator Stream Cipher RC4 RC4 and WEP

RC4 key: IV (24) Long-term key (40 or 104 bits) RC4 and WEP WEP is a protocol using RC4 to encrypt packets for transmission over IEEE 802.11 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. RC4 key: IV (24) Long-term key (40 or 104 bits) l

802.11 frames using WEP Header IV Packet ICV FCS l Header IV Packet ICV FCS encrypted ICV: integrity check value (for data integrity) FCS: frame check sequence (for error detection) Both use CRC32

WEP Vulnerability WEP protocol has several flaws but not the RC4 itself Short IV length 24 bits IV not sufficient Clear text IV as part of the key 24 bits of every key in cleartext Collect and analyze IVs to extract the WEP key Weak IVs Some generated IVs do not provide enough randomness Can be used to extract the key To form the stream key for en/decryption (which are identical), RC4 continues to shuffle the permutation array S by continuing to swap each element in turn with some other entry, and using the sum of these two entry values to select another value from the permutation to use as the stream key, which is then XOR’d with the current message byte. A number of papers have been published analyzing methods of attacking RC4, but none of these approaches is practical against RC4 with a reasonable key length, such as 128 bits. A more serious problem occurs in its use in the WEP protocol, not with RC4 itself but the way in which keys are generated for use as input to RC4. Currently RC4 its regarded as quite secure, if used correctly, with a sufficiently large key.

Q&A