CAP361: Security and Privacy of Information Lecture Number 05-08 Bhagat Avinash
CAP361: Security and Privacy of Information Lecture Number 05-08 Bhagat Avinash
CAP361: Security and Privacy of Information Lecture Number 05-08 Bhagat Avinash
3/1/2013
cryptanalysis (codebreaking) study of principles/ methods of deciphering ciphertext without knowing key
cryptology field of both cryptography and cryptanalysis
Symmetric Encryption and Message Confidentiality 3
Requirements
Two requirements for secure use of encryption:
1. a strong encryption algorithm 2. a secret key known only to sender / receiver
mathematically have:
Y = E(K, X) X = D(K, Y)
Cryptography
Cryptanalysis
The process of attempting to discover the plaintext or key Objective to recover key not just message general approaches:
cryptanalytic attack brute-force attack
Cryptanalysis
Cryptanalytic Attacks : 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. This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific plaintext or to deduce the key being used.
Cryptanalysis
Brute-force attack : The attacker tries every possible key on a piece of ciphertext until an intelligible translation into plaintext is obtained. On average, half of all possible keys must be tried to achieve success.
Type of Attack
Known to Cryptanalyst
Ciphertext only
Encryption algorithm
Ciphertext Encryption algorithm Ciphertext One or more plaintext-ciphertext pairs formed with the secret key Encryption algorithm Ciphertext Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the secret key
10
Known plaintext
Chosen plaintext
Type of Attack
Chosen Ciphertext
Known to Cryptanalyst
Encryption algorithm
Ciphertext Purported ciphertext chosen by cryptanalyst, together with its corresponding decrypted plaintext generated with the secret key
Chosen text
Encryption algorithm
Ciphertext Plaintext message chosen by cryptanalyst, together with its corresponding ciphertext generated with the secret key
Purported ciphertext chosen by cryptanalyst, together with its corresponding decrypted plaintext Symmetric Encryption and Message generated with the secret key Confidentiality
11
12
The most commonly used symmetric encryption algorithms are block cipher. A block cipher processes the plaintext input in fixed sized blocks and produces a block of ciphertext of equal size Feistel Cipher Structure
Data Encryption Standard Triple DES(3DES) Advanced Encryption Standard.
Symmetric Encryption and Message Confidentiality
13
Feistel Cipher Structure is a particular example of the more general structure used by all symmetric block ciphers. It consists of
Sequence of rounds With each round performing substitutions and permutations conditioned by a secret key value.
14
The plain text block is divided into two halves, LE0 and RE0. The two halves of the data pass through n rounds of processing and then combine to provide cipher text block.
Symmetric Encryption and Message Confidentiality
15
16
17
Round i
Li-1 Ri-1
f +
ki
Li
Ri
18
19
Key size
Larger key size means greater security but it reduces encryption / decryption speed typical size 128 bits
Number of rounds
Single round offers inadequate security. Multiple rounds offers greater security. Generally 16 rounds
21
Round function
Grater complexity generally means greater resistance to cryptanalysis.
22
23
DES History
IBM developed Lucifer cipher
DES : Basic Principles DES is a Block Cipher. It Encrypts data in blocks of size 64 bits each 64 bits of plain text goes as the input to DES, which
26
27
DES - Basics
DES uses the two basic techniques of cryptography
28
29
3.
30
process
5. In the End, LPT and RPT are rejoined, and a Final Permutation (FP) is performed on the combined block
31
32
33
34
Where
C = ciphertext P = plaintext
35
36
There is no cryptographic significance to the use of decryption for the second stage of 3DES encryption. Its only advantage is that it allows users of 3DES to decrypt data encrypted by the user of the older single DES.
37
38
Random Numbers
A number of network security algorithms based on cryptography make use of random numbers e.g.
Generation of keys for the RSA public key encryption algorithm and other public key algorithms. Generation of a stream key for symmetric stream cipher. Generation of symmetric key for use of a temporary session key. In a number of key distribution scenarios such as Kerberos.
39
41
42
Stream Cipher
Block vs Stream Cipher A stream cipher processes the input elements continuously, producing output one element at a time as it goes along. Block Ciphers process plain text in large blocks Stream ciphers process plain text in small blocks, even bits. Pure Block ciphers are memory less Stream cipher encryption depends not only on the plain text, , key but also on current state.
Symmetric Encryption and Message Confidentiality 43
Stream Cipher
Stream Cipher Structure A typical stream cipher encrypts plain text one bit or byte or some times more at a time
44
Stream Cipher
Stream Cipher Structure A key is input to a pseudorandom bit generator that produces a stream of 8 bit numbers that are apparently random. A pseudorandom stream is one that is unpredictable without the knowledge of input key.
45
46
2. 3. 4.
The encryption sequence should have long period with no repetitions the longer the period of repeat, the more difficult it will be to do cryptanalysis. Keystream should be truly random random depends on large enough key large linear complexity
47
RC4
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.
48
RC4
Analysis shows that the period of the cipher is overwhelmingly likely to be greater than 10100 [ROBS95a]. Eight to sixteen machine operations are required per output byte, and the cipher can be expected to run very quickly in software. RC4 is used in the SSL/TLS (Secure Sockets Layer/Transport Layer Security) standards that have been defined for communication between Web browsers and servers.
Symmetric Encryption and Message Confidentiality 49
RC4
It is also used in the WEP (Wired Equivalent Privacy) protocol and the newer WiFi Protected Access (WPA) protocol that are part of the IEEE 802.11 wireless LAN standard. RC4 was kept as a trade secret by RSA Security. In September 1994, the RC4 algorithm was anonymously posted on the Internet on the Cypherpunks anonymous remailers list.
50
RC4
The RC4 algorithm is remarkably simply and quite easy to explain. A variable-length key of from 1 to 256 bytes (8 to 2048 bits) is used to initialize a 256-byte state vector S, with elements S[0], S[1],..., S[255].
51
RC4
For encryption and decryption, a byte k (see Figure) is generated from S by selecting one of the 255 entries in a systematic fashion. As each value of k is generated, the entries in S are once again permuted.
52
Modes of Operation
A block cipher algorithm is a basic building block for providing data security. To apply a block cipher in a variety of applications, four "modes of operation" have been defined by NIST (FIPS 81). The four modes are intended to cover virtually all the possible applications of encryption for which a block cipher could be used.
53
Modes of Operation
1. 2. 3. 4. Electronic Codebook (ECB) Cipher Block Chaining (CBC) Cipher Feedback (CFB) /Output Feedback (OFB) Counter (CTR)
54
55
56
Advantages and Limitations of ECB The ECB method is ideal for a short amount of data, such as an encryption key. Thus, if you want to transmit a DES key securely, ECB is the appropriate mode to use. The most significant characteristic of ECB is that the same b-bit block of plaintext, if it appears more than once in the message, always produces the same ciphertext.
57
Advantages and Limitations of ECB For lengthy messages, the ECB mode may not be secure. If the message is highly structured, it may be possible for a cryptanalyst to exploit these regularities.
e.g., if it is known that the message always starts out with certain predefined fields, then the cryptanalyst may have a number of known plaintext-ciphertext pairs to work with. If the message has repetitive elements, with a period of repetition a multiple of b bits, then these elements can be identified by the analyst. This may help in the analysis or may provide an opportunity for substituting or rearranging blocks.
Symmetric Encryption and Message Confidentiality 58
59
60
61
62
63
65
Counter (CTR)
Although interest in the counter mode (CTR) has increased recently, with applications to ATM (asynchronous transfer mode) network security and IPSec (IP security), this mode was proposed early on .
67
Counter (CTR)
In CTR mode, A counter, equal to the plaintext block size is used. The only requirement is that the counter value must be different for each plaintext block that is encrypted. Typically, the counter is initialized to some value and then incremented by 1 for each subsequent block (modulo 2b where b is the block size).
68
Counter (CTR)
For encryption, the counter is encrypted and then XORed with the plaintext block to produce the ciphertext block; there is no chaining. For decryption, the same sequence of counter values is used, with each encrypted counter XORed with a ciphertext block to recover the corresponding plaintext block.
69
Counter (CTR)
70
efficiency
can do parallel encryptions in h/w or s/w can preprocess in advance of need good for bursty high speed links
random access to encrypted data blocks provable security (good as other modes) but must ensure never reuse key/counter values, otherwise could break (cf OFB)
Symmetric Encryption and Message Confidentiality 71
Questions
1. What are the essential ingredients of a symmetric cipher? 2. What are the two basic functions used in encryption algorithms? 3. What is the difference between a block cipher and a stream cipher? 4. How many keys are required for two people to communicate via a symmetric cipher? 5. What are the two approaches to attacking a cipher? 6. Why do some block cipher modes of operation only use encryption while others uses both encryption and decription? 7. What is triple Encryption? 8. Define Brute force and cryptanalytic attack? 9. How do we classify encryption techniques ----2
72
Questions
10. Write steps for Feistel Cipher Encryption techniques. 11. What are the parameters that are considered for designing a symmetric block cipher? 12. Explain cipher block modes of operation? 13. What are advantages and disadvantages of cipher block modes of operation?
73