EE 595 (PMP) Advanced Topics in Communication Theory Handout #1
Total Page:16
File Type:pdf, Size:1020Kb
EE 595 (PMP) Advanced Topics in Communication Theory Handout #1 Introduction to Cryptography. Symmetric Encryption.1 Wednesday, January 13, 2016 Tamara Bonaci Department of Electrical Engineering University of Washington, Seattle Outline: 1. Review - Security goals 2. Terminology 3. Secure communication { Symmetric vs. asymmetric setting 4. Background: Modular arithmetic 5. Classical cryptosystems { The shift cipher { The substitution cipher 6. Background: The Euclidean Algorithm 7. More classical cryptosystems { The affine cipher { The Vigen´erecipher { The Hill cipher { The permutation cipher 8. Cryptanalysis { The Kerchoff Principle { Types of cryptographic attacks { Cryptanalysis of the shift cipher { Cryptanalysis of the affine cipher { Cryptanalysis of the Vigen´erecipher { Cryptanalysis of the Hill cipher Review - Security goals Last lecture, we introduced the following security goals: 1. Confidentiality - ability to keep information secret from all but authorized users. 2. Data integrity - property ensuring that messages to and from a user have not been corrupted by communication errors or unauthorized entities on their way to a destination. 3. Identity authentication - ability to confirm the unique identity of a user. 4. Message authentication - ability to undeniably confirm message origin. 5. Authorization - ability to check whether a user has permission to conduct some action. 6. Non-repudiation - ability to prevent the denial of previous commitments or actions (think of a con- tract). 7. Certification - endorsement of information by a trusted entity. In the rest of today's lecture, we will focus on three of these goals, namely confidentiality, integrity and authentication (CIA). In doing so, we begin by introducing the necessary terminology. 1 We thank Professors Radha Poovendran and Andrew Clark for the help in preparing this material. 1 1 Terminology 1.1 Crytpology, cryptography and cryptanalysis: Cryptology is an all-inclusive term for the study of communication over insecure and unreliable communi- cation channels. Cryptography is an algorithmic process of designing communication systems capable of realizing secure communication, and cryptanalysis is a process of analyzing cryptosystems, for the purpose of breaking the secrecy of the communication. 1.2 Communication channel and communicating parties A communication channel is a physical medium over which communication occurs. It can be either wired (e.g. copper wire, optic fiber) or wireless (e.g. radio). Communicating parties are entities wishing to (secretly) communicate. In the case of two-party communication, they are often referred to as (A)lice and (B)ob. Communicating parties can employ different modes of communication, such as: { Unicast: One-to-one or point-to-point communication. { Multicast: One-to-many or point-to-multipoint communication. { Broadcast: One-to-any or point-to-any point communication.2 1.3 Attacker Attacker, adversary or opponent is an entity communicating parties wish to conceal the information from. We typically differentiate between two types of attackers: { Eavesdropper - an attacker passively observing the communication channel (referred to as Eve). { An attacker actively trying to manipulate (decrypt) the communicated information (referred to as Mal- lory). 1.4 Plaintext and Ciphertext Plaintext is any information that Alice may wish to communicate to Bob. It can be text, numerical data, or anything else. Ciphertext is defined as a message that is transmitted over an insecure channel after the plaintext has been encrypted. Decryption of the ciphertext using the correct decryption algorithm and decryption key should produce the corresponding plaintext. 1.5 Encryption and Decryption Encryption is defined as a process of creating a ciphertext from a plaintext by using an encryption key K and following an encryption rule (algorithm) eK . Similarly, decryption is the process of obtaining the plaintext from a ciphertext by using a decryption key K and following a decryption rule (algorithm) dK . Encryption/decryption key(s) is secret shared by the communicating parties that is used in cryptographic operations. Thus, a cryptographic system can formally be described as follows. 1.6 Formal description of a cryptosystems A cryptosystem is a 5-tuple (P; C; K; E; D). 1. P is the set of possible plaintexts. 2. C is the set of possible ciphers. 3. K is the set of possible keys. 4. E is the encryption rule set. 5. D is the decryption rule set. 2 Multicast can be seen as a special case of broadcast communication. 2 Let x 2 P, K 2 K. Encryption is a rule eK 2 E, and decryption is a rule dK 2 D. In order to have a well-defined cryptosystem, we require: dK (eK (x)) = x: (1) In words, decryption should recover the original plaintext. 2 Secure Communication Let's now assume that Alice wants to send a message to Bob over an insecure channel, and that neither Alice nor Bob want this information to be readable by any other parties. 1. What does Alice do? (a) Alice takes plaintext x = x1x2 : : : xn for some integer n ≥ 1; where 8i; xi 2 P; and encrypts it with a key K 2 K, using the encryption rule eK to generate ciphertext (cipher) y = y1y2 : : : yn: (b) She then transmits the cipher y over the insecure channel. 2. What does Bob do? (a) Bob knows the key K and the decryption algorithm dK . (b) He receives the cipher y and runs decryption. (c) Bob recovers the plaintext x = dK (y). 2.1 Symmetric vs. Asymmetric Setting Encryption/decryption algorithms can broadly be divided into two groups: symmetric key and public key. In symmetric key algorithms, the encryption and decryption keys are known to both Alice and Bob. For example, the encryption and the decryption key might be the same, or the encryption key is shared, and the decryption key is easily calculated from it. In public key algorithms (also known as asymmetric key algorithms), the encryption key is made public, but it is computationally infeasible to find the decryption key without information known only to a party intended to receive the ciphertext. Simple (non-mathematical) way of thinking about public key communication: Bob sends Alice a box and an unlocked padlock. Alice puts her message in the box, locks Bob's lock on it, and sends the box back to Bob. Now only Bob can open the box, and read the message. 3 Background: Modular Arithmetic In many cryptographic systems, the communicated messages are represented by numerical values prior to being encrypted and transmitted. For example, the English alphabet consists of 26 letters. As shown in Table 1, we can denote the element of the alphabet with corresponding numbers. A B C D E F G H I J K L M 0 1 2 3 4 5 6 7 8 9 10 11 12 N O P Q R S T U V W X Y Z 13 14 15 16 17 18 19 20 21 22 23 24 25 Table 1. Mapping of alphabets to numerals The encryption processes can now be thought of as mathematical operations that turn the input nu- merical values into output numerical values. Building, analyzing and attacking such cryptosystems requires mathematical tools, and the most important of these is number theory. 3 Definition 1. Let a and b be integers, a; b 2 Z and let m be a positive integer, m 2 Z+: If m divides (a − b), we can write: a ≡ b (mod m) (2) or mj(a − b) (3) The operator ≡ is called congruence and a ≡ b (mod m) is read: \a is congruent to b modulo m:" The positive integer m is known as the modulus. 3.1 Properties of modulo arithmetic Let Zm denote the set of integers f0; 1; 2; : : : ; m − 1g: 1. a ≡ b (mod m) if and only if a (mod m) = b (mod m); i.e. the remainders of a and b modulo m are equal. 2. Addition is closed: for any a; b 2 Zm; a + b 2 Zm: 3. Addition is commutative: for any a; b 2 Zm; a + b = b + a: 4. Addition is associative: for any a; b; c 2 Zm; (a + b) + c = a + (b + c): 5. 0 is an additive identity: for any a 2 Zm; a + 0 = 0 + a = a: 6. The additive inverse of any a 2 Zm is m − a: that is a + (m − a) = (m − a) + a = 0; 8a 2 Zm: 7. Multiplication is closed: for any a; b 2 Zm; ab 2 Zm: 8. Multiplication is commutative: for any a; b 2 Zm; ab = ba: 9. Multiplication is associative: for any a; b; c 2 Zm; (ab)c = a(bc): 10. 1 is the multiplicative identity: for any a 2 Zm; a × 1 = 1 × a = a: 11. The distributive property is satisfied: for any a; b; c 2 Zm; (a+b)c = (ac)+(bc) and a(b+c) = (ab)+(ac): Properties 1, 3-5, say that Zm forms a group. Since property 2 also holds, the group is called an abelian group. Properties 1-10 make Zm a ring. We can also define subtraction in Zm as (a − b) mod m: 4 Classical Cryptosystems Methods of making communicated messages unintelligible to attackers have been important throughout history. In this section, we cover some of this older cryptosystems that were primarily used before the advent of computers. In doing so, we will make use of number theory, especially modular arithmetic we just reviewed. We start with the shift cipher. 4.1 The Shift Cipher The shift cipher is one of the oldest known cryptosystems, often attributed to Julius Caesar. The idea used in this cryptosystem is to replace each letter in an alphabet by another letter at a distance K from it. Formally, let's associate each letter A; B; :::; Z with an integer 0;:::; 25. If we allow the key K to be any integer with 0 ≤ K ≤ 25, the shift cipher can be defined as: P = C = K = Z26.