EEC 688/788 Secure and Dependable Computing

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Using Cryptography to Secure Information. Overview Introduction to Cryptography Using Symmetric Encryption Using Hash Functions Using Public Key Encryption.
“Advanced Encryption Standard” & “Modes of Operation”
Cryptology  Terminology  plaintext - text that is not encrypted.  ciphertext - the output of the encryption process.  key - the information required.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC 688/788 Secure and Dependable Computing Lecture 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC 688/788 Secure and Dependable Computing Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
EEC 693/793 Special Topics in Electrical Engineering Secure and Dependable Computing Lecture 5 Wenbing Zhao Department of Electrical and Computer Engineering.
EEC-484/584 Computer Networks Lecture 18 Wenbing Zhao (Part of the slides are based on materials supplied by Prentice-Hall)
Computer Networking Lecture 21: Security and Cryptography Thanks to various folks from , semester’s past and others.
Lecture 23 Symmetric Encryption
Lecture 1 Overview.
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
IT 221: Classical and Modern Encryption Techniques Lecture 2: Classical and Modern Encryption Techniques For Educational Purposes Only Revised: September.
Cryptography Week-6.
Block Cipher Transmission Modes CSCI 5857: Encoding and Encryption.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Lecture 2 Overview.
Chapter 2 – Elementary Cryptography  Concepts of encryption  Cryptanalysis  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public.
Chapter 20 Symmetric Encryption and Message Confidentiality.
ITMS – 3153 Information Systems Security
Chapter 20 Symmetric Encryption and Message Confidentiality.
9/03/15UB Fall 2015 CSE565: S. Upadhyaya Lec 2.1 CSE565: Computer Security Lecture 2 Basic Encryption & Decryption Shambhu Upadhyaya Computer Science &
Elementary Cryptography  Concepts of encryption  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public key) Encryption (RSA)(RSA)
Cryptography (Traditional Ciphers)
Lecture 3 Page 1 Advanced Network Security Review of Cryptography Advanced Network Security Peter Reiher August, 2014.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
Security in Computing Cryptography (Traditional Ciphers)
Lecture 23 Symmetric Encryption
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
EEC 688/788 Secure and Dependable Computing Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Lecture 3 Page 1 CS 236 Online Introduction to Cryptography CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Lecture 2 Overview. Cryptography Secret writing – Disguised data cannot be read, modified, or fabricated easily – Feasibility of complexity for communicating.
Chapter Two: Classic Cryptography
Department of Computer Science Chapter 5 Introduction to Cryptography Semester 1.
1 Introduction to Cryptography Chapter-4. Definitions  Cryptography = the science (art) of encryption  Cryptanalysis = the science (art) of breaking.
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.
CS480 Cryptography and Information Security
Algorithm Modes ECB, CBC, CFB, OFB.
Computer and Network Security
CSE565: Computer Security Lecture 2 Basic Encryption & Decryption
Chapter 2 Basic Encryption and Decryption
Chapter-2 Classical Encryption Techniques.
Cryptography.
Outline Desirable characteristics of ciphers Stream and block ciphers
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
Cryptography II Jagdish S. Gangolly School of Business
PART VII Security.
Algorithm Types & Algorithm Modes
Block vs Stream Ciphers
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
SYMMETRIC ENCRYPTION.
Cryptanalysis Network Security.
Secret-Key Encryption
Presentation transcript:

EEC 688/788 Secure and Dependable Computing Lecture 2 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University wenbing@ieee.org

EEC688: Secure & Dependable Computing Outline Introduction to cryptography Terminology Basic encryption methods One time pad Symmetric-key algorithms DES, AES, etc Cipher modes 11/20/2018 EEC688: Secure & Dependable Computing

Cryptography Terminology Encryption is the process of encoding a message so that its meaning is not obvious Equivalent terms: encode, encipher Decryption is the reverse process, transforming an encrypted message back into its normal, original form Equivalent terms: decode, decipher Plaintext: message to be encrypted Ciphertext: encrypted message 11/20/2018 EEC688: Secure & Dependable Computing

Cryptography Terminology The cryptosystem involves a set of rules for how to encrypt the plaintext and how to decrypt the ciphertext Why encryption? It addresses the need for confidentiality of data, also helps to ensure integrity It forms the basis of protocols that enable us to provide security while accomplishing system or network tasks 11/20/2018 EEC688: Secure & Dependable Computing

Cryptography Terminology The encryption and decryption rules are called encryption and decryption algorithms Encryption/decryptions algorithms often use a device called a key, denoted by K, so that the resulting ciphertext depends on the original plaintext message, the algorithm, and the key value An encryption scheme that does not require the use of a key is called a keyless cipher 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Symmetric Encryption The encryption and decryption keys are the same, so P = D(K, E(K,P)) D and E are closely related. They are mirror-image processes The symmetric systems provide a two-way channel to their users The symmetry of this situation is a major advantage of this type of encryption, but it also leads to a problem: key distribution 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Symmetric Encryption DK(EK(P)) = P 11/20/2018 EEC688: Secure & Dependable Computing

Asymmetric Encryption Encryption and decryption keys come in pairs. The decryption key, KD, inverts the encryption of key KE, so that P = D(KD, E(KE,P)) Asymmetric encryption systems excel at key management 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Cryptology Cryptology is the research into and study of encryption and decryption; it includes both cryptography and cryptanalysis Cryptography – art of devising ciphers Comes from Greek words for “secret writing”. It refers to the practice of using encryption to conceal text Cryptanalysis – art of breaking ciphers Study of encryption and encrypted messages, hoping to find the hidden meanings 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Cryptanalysis Attempt to break a single message Attempt to recognize patterns in encrypted messages, to be able to break subsequent ones Attempt to deduce the key, in order to break subsequent messages easily Attempt to find weaknesses in the implementation or environment of use of encryption Attempt to find general weaknesses in an encryption algorithm 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Cryptanalysis Traffic analysis: attempt to infer some meaning without even breaking the encryption, e.g., Noticing an unusual frequency of communication Determining something by whether the communication was short or long 11/20/2018 EEC688: Secure & Dependable Computing

Cryptanalysis – Breaking Encryption Schemes Ciphertext-only: cryptanalyst has a quantity of ciphertext and no plaintext Known plaintext: cryptanalyst has some matched ciphertext and plaintext Chosen plaintext: cryptanalyst has the ability to encrypt pieces of plaintext of his own choosing 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 12

Basic Encryption Methods Substitution ciphers: one letter is exchanged for another Transposition ciphers: order of letters is rearranged 11/20/2018 EEC688: Secure & Dependable Computing

EEC688: Secure & Dependable Computing Substitution Ciphers Idea: each letter or group of letters is replaced by another letter or group of letters Caesar cipher – circularly shift by 3 letters a -> D, b -> E, … z -> C More generally, shift by k letters, k is the key Monoalphabetic cipher – map each letter to some other letter A b c d e f … w x y z Q W E R T Y … V B N M <= the key 11/20/2018 EEC688: Secure & Dependable Computing

Cryptanalysis of Substitution Ciphers Brute force cryptanalysis would have to try 26! permutations of a particular ciphertext message Smarter way: use frequencies of letters, pairs of letter etc., or by guessing a probable word or phrase. Most frequently occurred Letters: e, t, o, a, n, … Digrams: th, in, er, re, an, … Trigrams: the, ing, and, ion, ent Words: the, of, and, to, a, in, that, … When messages are long enough, the frequency distribution analysis quickly betrays many of the letters of the plaintext 11/20/2018 EEC688: Secure & Dependable Computing

Transposition Ciphers Substitution cipher – preserves order of plaintext symbols but disguises them Transposition cipher – reorders (rearrange) symbols but does not disguise them. It is also called permutation With transposition, the cryptography aims for Widely spreading the information from the message or the key across the ciphertext Transpositions try to break established patterns 11/20/2018 EEC688: Secure & Dependable Computing

Columnar Transposition Plaintext written in rows, number of columns = key length Key is used to number the columns Ciphertext read out by columns, starting with column whose key letter is lowest 11/20/2018 EEC688: Secure & Dependable Computing

Columnar Transposition A transposition cipher example 11/20/2018 EEC688: Secure & Dependable Computing

One-Time Pads One-time pad: construct an unbreakable cipher Choose a random bit string as the key Convert the plaintext into a bit string Compute the XOR of these two strings, bit by bit The resulting ciphertext cannot be broken, because in a sufficiently large sample of ciphertext, each letter will occur equally often, as will every digram, every trigram, and so on => There is simply no information in the message because all possible plaintexts of the given length are equally likely 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 19

One-Time Pads Disadvantages The key cannot be memorized, both sender and receiver must carry a written copy with them Total amount of data can be transmitted is limited by the amount of key available Sensitive to lost or inserted characters 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 20

Symmetric-Key Algorithms DES – The Data Encryption Standard AES – The Advanced Encryption Standard Other Ciphers Cipher Modes 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 21

Data Encryption Standard Developed by IBM. US standard for unclassified info (1977) Same key for encryption as for decryption Encrypts in 64-bit blocks Uses 56-bit key Has 19 stages, 16 parameterized by different functions of the key 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 22

Triple DES Triple DES – effectively increases the key length. It uses two keys and three stages In first stage, the plaintext is encrypted using DES in the usual way with K1 In second stage, DES is run in decryption mode, using K2 as the key In third stage, another DES encryption is done with K1 Triple DES has two variations: 2TDES and 3TDES 3TDES uses three keys, a different key in each stage 2TDES uses two keys as described here Triple DES encryption Triple DES decryption 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 23

AES – The Advanced Encryption Standard AES is a result of a cryptographic contest Organized by NIST in 1997 Rules for AES proposals The algorithm must be a symmetric block cipher The full design must be public Key lengths of 128, 192, and 256 bits supported Both software and hardware implementations required The algorithm must be public or licensed on nondiscriminatory terms Winner: Rijndael (from two Belgian cryptographers: Joan Daemen and Vincent Rijmen) 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 24

Other Symmetric-Key Ciphers 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 25

Stream Ciphers Stream ciphers: convert one symbol of plaintext immediately into a symbol of ciphertext The transformation depends only on the symbol, the key, and the control information of the encryption algorithm Some kinds of errors affect the encryption of all future characters 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 26

Block Ciphers Block cipher: encrypts a group of plaintext symbols as one block It works on blocks of plaintext and produce blocks of ciphertext The columnar transposition is an example of block ciphers 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Cipher Modes A block cipher (e.g., AES & DES) is basically a monoalphabetic substitution cipher using big characters Whenever the same plaintext block goes in the front end, the same ciphertext block comes out the back end If you encrypt the plaintext abcdefgh 100 times with same DES key, you get the same ciphertext 100 times An intruder can exploit this property to help subvert the cipher To do: should add a slide to discuss the need for padding 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 28

Electronic Code Book Mode In ECB mode, each plaintext block is encrypted independently with the block cipher ECB allows easy parallelization to yield higher performance. However, no processing is possible before a block is seen 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Electronic Code Book Mode - Problems In ECB, plaintext patterns are not concealed Each identical block of plaintext gives an identical block of ciphertext. The plaintext can be easily manipulated by removing, repeating, or interchanging blocks Example 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 30

Cipher Block Chaining Mode To avoid the ECB mode problem: replacing a block will cause the plaintext decrypted starting at the replaced to become garbage Exclusive OR the encrypted text with the next block of plaintext before encryption: Need an initialization vector (IV) to boostrap C0 = E(P0 XOR IV), C1 = E(P1 XOR C0), etc. Drawback: must wait until full 64-bit (128-bit) block to arrive to decrypt 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Cipher Block Chaining Mode Exclusive OR the encrypted text with the next block of plaintext before encryption: C0 = E(P0 XOR IV), C1 = E(P1 XOR C0), etc. Initialization Vector Encryption Decryption 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Cipher Feedback Mode Basic operation (Pi and Ci are blocks): Ci = E(Ci-1) XOR Pi, Pi = E(Ci-1) XOR Ci, C0 = IV Issue: Losing a single bit or byte will ruin all data after that A variation of the CFB mode is used in PGP CFB mode makes a block cipher into a self-synchronizing stream cipher 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 33

Cipher Feedback Mode To enable byte-by-byte encryption When plaintext byte n (Pn) arrives, DES algorithm operates a 64-bit register to generate a 64-bit ciphertext Leftmost byte of that ciphertext is extracted and XORed with Pn That byte is transmitted on the transmission line The shift register is shifted left 8 bits, causing Cn-8 to fall off the left end, and Cn is inserted in the position just vacated at the right end by C9 A variation of the CFB mode is used in PGP Drawback: One byte of transmission error will ruin 8 bytes of data 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 34

Cipher Feedback Mode Encryption Decryption Ask question: do we need an IV for CFB mode? Encryption Decryption 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 35

Stream Cipher Mode To be insensitive to transmission error, an arbitrarily large sequence of output blocks, called the keystream, is treated like a one-time pad and XORed with the plaintext to get the ciphertext It works by encrypting an IV, using a key to get an output block The output block is then encrypted, using the key to get a second output block This block is then encrypted to get a third block, and so on The keystream is independent of the data, so (1) It can be computed in advance (2) It is completely insensitive to transmission errors 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Stream Cipher Mode Encryption Decryption 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Stream Cipher Mode It is essential never to use the same (key, IV) pair twice with a stream cipher because doing so will generate the same keystream each time Using the same keystream twice exposes the ciphertext to a keystream reuse attack Stream cipher mode is also called output feedback mode 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Keystream Reuse Attack Plaintext block, P0, is encrypted with the keystream to get P0 XOR K0 Later, a second plaintext block, Q0, is encrypted with the same keystream to get Q0 XOR K0 An intruder who captures both ciphertext blocks can simply XOR them together to get P0 XOR Q0, which eliminates the key The intruder now has the XOR of the two plaintext blocks If one of them is known or can be guessed, the other can also be found In any event, the XOR of two plaintext streams can be attacked by using statistical properties of the message 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Counter Mode To allow random access to encrypted data The IV plus a constant is encrypted, and the resulting ciphertext XORed with the plaintext By stepping the IV by 1 for each new block, it is easy to decrypt a block anywhere in the file without first having to decrypt all of its predecessors 11/20/2018 11/20/2018 EEC688: Secure & Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 40

Exercise Q1. Assuming that the DES block cipher is used in the Electronic Code Book mode. If one bit in a block of ciphertext is inverted during transmission, how many bits will likely be damaged after decryption at the receiver? 11/20/2018 11/20/2018 EEC693: Secure and Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao

Exercise Q2. Assuming that the DES block cipher is used in the Cipher Block Chaining mode. If one bit of ciphertext is inverted during transmission, how many bits will likely be damaged after decryption at the receiver? 11/20/2018 11/20/2018 EEC693: Secure and Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 42

Exercise Q3. Assuming that the DES block cipher is used in the Cipher Feedback mode. If one bit of ciphertext is inverted during transmission, how many bits will likely be damaged after decryption at the receiver (for both variations)? 11/20/2018 11/20/2018 EEC693: Secure and Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao 43

Exercise Q4. Assuming that the DES block cipher is used in the Stream Cipher mode (it is also called output feedback mode). If one bit of ciphertext is inverted during transmission, how many bits will likely be damaged after decryption at the receiver? 11/20/2018 11/20/2018 EEC693: Secure and Dependable Computing EEC688: Secure & Dependable Computing Wenbing Zhao