Computer Science CSC 405By Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 2. Basic Cryptography (Part I)

Slides:



Advertisements
Similar presentations
CLASSICAL ENCRYPTION TECHNIQUES
Advertisements

Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.2 Secret Key Cryptography.
Making “Good” Encryption Algorithms
Computer Science CSC 474By Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.1 Introduction to Cryptography.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.
Cryptography and Network Security Chapter 3
Data Encryption Standard (DES)
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
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
Announcement Grading adjusted –10% participation and two exams 20% each Newsgroup up Assignment upload webpage up Homework 1 will be released over the.
Chapter 5 Cryptography Protecting principals communication in systems.
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
Introduction to Symmetric Block Cipher Jing Deng Based on Prof. Rick Han’s Lecture Slides Dr. Andreas Steffen’s Security Tutorial.
CS1001 Lecture 24. Overview Encryption Encryption Artificial Intelligence Artificial Intelligence Homework 4 Homework 4.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
Chapter 2 Basic Encryption and Decryption (part B)
Lecture 1 Overview.
Review What is security: history and definition Security policy, mechanisms and services Security models.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Computer Science CSC 774Dr. Peng Ning1 CSC 774 Advanced Network Security Topic 2. Review of Cryptographic Techniques.
CSE 651: Introduction to Network Security
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.
Encryption is a way to transform a message so that only the sender and recipient can read, see or understand it. The mechanism is based on the use of.
3.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 3 Traditional Symmetric-Key Ciphers.
Cryptography Week-6.
Chapter 2 Basic Encryption and Decryption. csci5233 computer security & integrity 2 Encryption / Decryption encrypted transmission AB plaintext ciphertext.
Lecture 2 Overview.
Security in Computing Cryptography (Introduction) Derived from Greek words: ‘Kruptos’ (hidden) and ‘graphein’ (writing.
Chapter 2 – Elementary Cryptography  Concepts of encryption  Cryptanalysis  Symmetric (secret key) Encryption (DES & AES)(DES & AES)  Asymmetric (public.
The School of Electrical Engineering and Computer Science (EECS) CS/ECE Network Security Dr. Attila Altay Yavuz Basics Credit: Prof. Dr. Peng Ning Network.
Cryptography, Authentication and Digital Signatures
Lec. 5 : History of Cryptologic Research II
ITMS – 3153 Information Systems Security
TE/CS 536 Network Security Spring 2006 – Lectures 6&7 Secret Key Cryptography.
Network Security Lecture 11 Presented by: Dr. Munam Ali Shah.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Module 3 – Cryptography Cryptography basics Ciphers Symmetric Key Algorithms Public Key Algorithms Message Digests Digital Signatures.
Symmetric-Key Cryptography
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.
Traditional Symmetric-Key Ciphers
Lecture 2: Introduction to Cryptography
Lecture 23 Symmetric Encryption
Computer Science and Engineering Computer System Security CSE 5339/7339 Lecture 3 August 26, 2004.
Symmetric Encryption Lesson Introduction ●Block cipher primitives ●DES ●AES ●Encrypting large message ●Message integrity.
K. Salah1 Cryptography Module I. K. Salah2 Cryptographic Protocols  Messages should be transmitted to destination  Only the recipient should see it.
Intro to Cryptography Lesson Introduction
DATA & COMPUTER SECURITY (CSNB414) MODULE 3 MODERN SYMMETRIC ENCRYPTION.
Lecture 3 Overview. Ciphers The intent of cryptography is to provide secrecy to messages and data Substitutions – ‘hide’ letters of plaintext Transposition.
Block Ciphers and the Data Encryption Standard. Modern Block Ciphers  One of the most widely used types of cryptographic algorithms  Used in symmetric.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Lecture 2 Overview. Cryptography Secret writing – Disguised data cannot be read, modified, or fabricated easily – Feasibility of complexity for communicating.
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
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.
CS/ECE 578 Cyber-Security Dr. Attila Altay Yavuz
CS/ECE Network Security Dr. Attila Altay Yavuz
IT443 – Network Security Administration Instructor: Bo Sheng
Cryptography.
مروري برالگوريتمهاي رمز متقارن(كليد پنهان)
Cryptography II Jagdish S. Gangolly School of Business
CS/ECE 478 Network Security Dr. Attila Altay Yavuz
Presentation transcript:

Computer Science CSC 405By Dr. Peng Ning1 CSC 405 Introduction to Computer Security Topic 2. Basic Cryptography (Part I)

Computer Science CSC 405By Dr. Peng Ning2 Cryptography –Original meaning: The art of secret writing –Becoming a science that relies on mathematics (number theory, algebra) –Process data into unintelligible form, reversible, without data loss –Usually one-to-one (not compression)

Computer Science CSC 405By Dr. Peng Ning3 plaintext encryption ciphertext decryption plaintext key Encryption/Decryption Plaintext: a message in its original form Ciphertext: a message in the transformed, unrecognized form Encryption: the process that transforms a plaintext into a ciphertext; also known as encode and encipher Decryption: the process that transforms a ciphertext to the corresponding plaintext; also known as decode and decipher Key: the value used to control encryption/decryption Cryptosystem: a system for encryption and decryption

Computer Science CSC 405By Dr. Peng Ning4 Cryptanalysis Ciphertext only: –Analyze only with the ciphertext –Example: Exhaustive search until “recognizable plaintext” –Smarter ways available Known plaintext: –Secret may be revealed (by spy, time), thus pair is obtained –Great for mono-alphabetic ciphers

Computer Science CSC 405By Dr. Peng Ning5 Cryptanalysis (Cont’d) Chosen plaintext: –Choose text, get encrypted –Useful if limited set of messages Chosen ciphertext: –Choose ciphertext –Get feedback from decryption, etc.

Computer Science CSC 405By Dr. Peng Ning6 Simple Forms of Encryption Substitutions –One letter is replaced with another Transpositions –Also called permutations –The order of the letters is rearranged Building blocks of modern cryptographic algorithms

Computer Science CSC 405By Dr. Peng Ning7 Substitution Ciphers Monoalphabetic cipher (simple substitution) –Use a correspondence table –Substitute a character or symbol for each character of the original message –Example: Caesar cipher Replace each letter with the one 3 letters later Exercise –E (“COMPUTER SCIENCE”)  –D (“qf vwdwh”)  ABCDEFGHIJKLM defghijklmnop NOPQRSTUVWXYZ qrstuvwxyzabc

Computer Science CSC 405By Dr. Peng Ning8 Caesar Cipher Cryptanalysis of Caesar cipher –Can be done by guessing Clues –Break between two words is preserved You can try common letters starting or ending a word –Double letters are preserved –Always use the same mapping –Exercise: wklv phvvdjh lv qrw wrr kdug wr euhdn

Computer Science CSC 405By Dr. Peng Ning9 Other Substitutions In general –The alphabet is scrambled –Each plaintext letter maps to a unique ciphertext letter –A substitution table can be defined using a permutation A permutation is a reordering of the elements of a sequence ABCDEFGHIJKLM dxfthiwkymnop NOPQRSTUVWXYZ qrsguvjelzabc

Computer Science CSC 405By Dr. Peng Ning10 Cryptanalysis of Substitution Ciphers Ad hoc clues –Short words, words with repeated patterns, common initial and final letters Language specific knowledge –Frequency of letters E, T, O, and A occur far more often than J, Q, X, and Z –Letter patterns th, er, en, ss, st, …

Computer Science CSC 405By Dr. Peng Ning11 One-Time Pads Encrypt plaintext with a large, non-repeating set of keys –Absolute synchronization between sender and receiver –Unlimited number of keys Vernam cipher

Computer Science CSC 405By Dr. Peng Ning12 Book Cipher Use book, piece of music, or other object with which structure can be analyzed –Both sender and receiver need access to identical objects –Example: book cipher with Vigenère tableau Key: I am, I exist, that is certain. Plaintext: MACHINES CANNOT THINK iamie xistt hatis cert MACHI NESCA NNOTT HINK Uaopm kmkvt unbhl jmed column row

Computer Science CSC 405By Dr. Peng Ning13 a b c d e f g h i j k l m n o p q r s t u v w x y z A a b c d e f g h i j k l m n o p q r s t u v w x y z B b c d e f g h i j k l m n o p q r s t u v w x y z a C c d e f g h i j k l m n o p q r s t u v w x y z a b D d e f g h i j k l m n o p q r s t u v w x y z a b c E e f g h i j k l m n o p q r s t u v w x y z a b c d F f g h i j k l m n o p q r s t u v w x y z a b c d e G g h i j k l m n o p q r s t u v w x y z a b c d e f H h i j k l m n o p q r s t u v w x y z a b c d e f g I i j k l m n o p q r s t u v w x y z a b c d e f g h J j k l m n o p q r s t u v w x y z a b c d e f g h i K k l m n o p q r s t u v w x y z a b c d e f g h i j L l m n o p q r s t u v w x y z a b c d e f g h i j k M m n o p q r s t u v w x y z a b c d e f g h i j k l … Vigenère Tableau

Computer Science CSC 405By Dr. Peng Ning14 Cryptanalysis of Book Cipher Flaw of book cipher –Distributions of both key and message cluster around high frequency letters –Example A, E, O, T, N, I account for 50% of all letters Probability of both key and plaintext letters are one of them: 0.25 Cryptanalysis –Look for intersections of the above six letters –For each cipher text letter, identify the possible plaint text letter from those intersections uaopm kmkvt unbhl jmed ?AA?E ?E??A ?ANN? ?EA? O I I T NTT IE T T T Correct prediction underlined

Computer Science CSC 405By Dr. Peng Ning15 Transpositions (Permutations) Letters of the message are rearranged –Aim to break established patterns Confusion and diffusion –Confusion Make it difficult to determine how message and key are transformed into cipher text Complex relationship between plaintext, key, and ciphertext Done through substitution –Diffusion Widely spread the information from the message or key across the cipher text Done through transposition (permutation)

Computer Science CSC 405By Dr. Peng Ning16 Columnar Transpositions Rearrange characters of the plain text into columns Key: Plaintext:ATTACKP OSTPONE DUNTILT WOAMXYZ Cipher text: ______________________________________

Computer Science CSC 405By Dr. Peng Ning17 Cryptanalysis of Transpositions Diagram analysis –Frequent diagram Patterns of pairs of adjacent letters RE, EN, ER, NT, … –Frequent trigrams Groups of three letters ENT, ION, AND, ING, … –Infrequent diagrams and trigrams VK and QP

Computer Science CSC 405By Dr. Peng Ning18 Cryptanalysis by Diagram Analysis Confirms it is a transposition –Compute the letter frequencies Find adjacent columns –Try different column sizes –Look for common diagrams –Verify possible matches for different positions Rely heavily on a human’s judgment of what “looks right”

Computer Science CSC 405By Dr. Peng Ning19 Product Cipher Product cipher –Combination of two ciphers –Modern ciphers: interleaved substitutions and transpositions (permutations) –S  P  S  P  … But –How about S  P  S  S  P  … –How about S  P  P  S  …

Computer Science CSC 405By Dr. Peng Ning20 “Good” Encryption algorithms What does it mean for a cipher to be “good”? –Meaning of “good” depends on intended use of the cipher –Commercial applications –Military applications

Computer Science CSC 405By Dr. Peng Ning21 Characteristics of “Good” Ciphers Shannon’s principles –The amount of secrecy needed should determine the amount of labor appropriate for the encryption and decryption –The set of keys and the enciphering algorithm should be free from complexity No restrictions on keys or plain text; keys should be short –The implementation of the process should be as simple as possible Formulated with hand encryption in mind Implementation on a computer need not be simple, as long as the time complexity is tolerable

Computer Science CSC 405By Dr. Peng Ning22 Characteristics of “Good” Ciphers Shannon’s Principles (Cont’d) –Errors in ciphering should not propagate and cause corruption of further information in the message No error propagation –The size of the enciphered text should be no larger than the text of the original message Dramatic cipher expansion in size does not carry more information, but It gives the cryptanalyst more data to infer patterns

Computer Science CSC 405By Dr. Peng Ning23 Security of An Encryption Algorithm Unconditionally secure –It is impossible to decrypt the ciphertext –One-time pad (the key is as long as the plaintext) Computationally secure –The cost of breaking the cipher exceeds the value of the encrypted information –The time required to break the cipher exceeds the useful lifetime of the information

Computer Science CSC 405By Dr. Peng Ning24 Secret Keys v.s. Secret Algorithms Security by obscurity –We can achieve better security if we keep the algorithms secret –Hard to keep secret if used widely –Reverse engineering, social engineering Publish the algorithms –Security of the algorithms depends on the secrecy of the keys –Less unknown vulnerability if all the smart (good) people in the world are examine the algorithms

Computer Science CSC 405By Dr. Peng Ning25 Secret Keys v.s. Secret Algorithms (Cont’d) Commercial world –Published –Wide review, trust Military –Keep algorithms secret –Avoid giving enemy good ideas –Military has access to the public domain knowledge anyway.

Computer Science CSC 405By Dr. Peng Ning26 Types of Cryptography Number of keys –Hash functions: no key –Secret key cryptography: one key –Public key cryptography: two keys - public, private The way in which the plaintext is processed –Block cipher: divides input elements into blocks –Stream cipher: process one element (e.g., bit) a time

Computer Science CSC 405By Dr. Peng Ning27 plaintext encryption ciphertext decryption plaintext key Same key Secret Key Cryptography Same key is used for encryption and decryption Also known as –Symmetric cryptography –Conventional cryptography

Computer Science CSC 405By Dr. Peng Ning28 Secret Key Cryptography (Cont’d) Basic technique –Product cipher –Multiple applications of interleaved substitutions and permutations Cipher text approximately the same length as plaintext plaintext SPSPS ciphertext … key

Computer Science CSC 405By Dr. Peng Ning29 Stream and Block Ciphers Stream ciphers –Convert one symbol of plaintext immediately into a symbol of ciphertext A symbol: a character, a bit –Examples Substitution ciphers discussed earlier Modern example: RC4

Computer Science CSC 405By Dr. Peng Ning30 Stream and Block Ciphers (Cont’d) Block cipher –Encrypt a group of plaintext symbols as on block –Examples Columnar transposition Modern examples: DES, AES

Computer Science CSC 405By Dr. Peng Ning31 Applications of Secret Key Cryptography Transmitting over an insecure channel –Challenge: How to share the key? Secure Storage on insecure media Authentication –Challenge-response –To prove the other party knows the secret key –Must be secure against chosen plaintext attack Integrity check –Message Integrity Code (MIC) –Also called Message Authentication Code (MAC)

Computer Science CSC 405By Dr. Peng Ning32 plaintext encryption ciphertext decryption plaintext Public keyPrivate key Public Key Cryptography Invented/published in 1975 A public/private key pair is used –Public key can be publicly known –Private key is kept secret by the owner of the key Much slower than secret key cryptography Also known as –Asymmetric cryptography

Computer Science CSC 405By Dr. Peng Ning33 message Sign Digital signature Verify Yes/No Private keyPublic key Public Key Cryptography (Cont’d) Another mode: digital signature –Only the party with the private key can create a digital signature. –The digital signature is verifiable by anyone who knows the public key. –The signer cannot deny that he/she has done so.

Computer Science CSC 405By Dr. Peng Ning34 Applications of Public Key Cryptography Data transmission –Alice encrypts m a using Bob’s public key e B, Bob decrypts m a using his private key d B. Storage –Can create a safety copy: using public key of trusted person. Authentication –No need to store secrets, only need public keys. –Secret key cryptography: need to share secret key for every person to communicate with.

Computer Science CSC 405By Dr. Peng Ning35 Applications of Public Key Cryptography (Cont’d) Digital signatures –Sign hash H(m) with the private key Authorship Integrity Non-repudiation: can’t do with secret key cryptography Key exchange –Establish a common session key between two parties

Computer Science CSC 405By Dr. Peng Ning36 Message of arbitrary length Hash H A fixed-length short message Hash Algorithms Also known as –Message digests –One-way transformations –One-way functions –Hash functions Length of H(m) much shorter then length of m Usually fixed lengths: 128 or 160 bits

Computer Science CSC 405By Dr. Peng Ning37 Hash Algorithms (Cont’d) Desirable properties of hash functions –Performance: Easy to compute H(m) –One-way property: Given H(m) but not m, it’s difficult to find m –Weak collision free: Given H(m), it’s difficult to find m’ such that H(m’) = H(m). –Strong collision free: Computationally infeasible to find m 1, m 2 such that H(m 1 ) = H(m 2 )

Computer Science CSC 405By Dr. Peng Ning38 Applications of Hash Functions Primary application –Generate/verify digital signature Message m H H(m) Sign Private key Signature Sig(H(m)) Message m H H(m) Verify Public key Signature Sig(H(m)) Yes/No

Computer Science CSC 405By Dr. Peng Ning39 Applications of Hash Functions (Cont’d) Password hashing –Doesn’t need to know password to verify it –Store H(password+salt) and salt, and compare it with the user-entered password –Salt makes dictionary attack more difficult Message integrity –Agree on a secrete key k –Compute H(m|k) and send with m –Doesn’t require encryption algorithm, so the technology is exportable

Computer Science CSC 405By Dr. Peng Ning40 DES (Data Encryption Standard) Officially adopted in 1976 Expired in 1998 Key: 64 bit quantity=8-bit parity+56-bit key –Every 8th bit is a parity bit. 64 bit input, 64 bit output. DES Encryption 64 bit M64 bit C 56 bits

Computer Science CSC 405By Dr. Peng Ning41 DES Top View Permutation Swap Round 1 Round 2 Round 16 Generate keys Initial Permutation 48-bit K1 48-bit K2 48-bit K16 Swap 32-bit halves Final Permutation 64-bit Output 64-bit Input 56-bit Key …...

Computer Science CSC 405By Dr. Peng Ning42 Bit Permutation (1-to-1) ……. …… Input: Output bit

Computer Science CSC 405By Dr. Peng Ning43 Initial and Final Permutations Initial permutation (IP) View the input as M: 8 X 8 bit matrix Transform M into M’ in two steps –Transpose row x into column (9-x), 0<x<9 –Apply permutation on the rows: For even row y, it becomes row y/2 For odd row y, it becomes row (5+y/2) Final permutation FP = IP -1

Computer Science CSC 405By Dr. Peng Ning44 Per-Round Key Generation 28 bits 48 bits K i Circular Left Shift 28 bits Permutation with Discard Initial Permutation of DES key C i-1 D i-1 C i D i Round 1,2,9,16: single shift Others: two bits

Computer Science CSC 405By Dr. Peng Ning45 A DES Round 48 bits 32 bits E-Boxes S-Boxes P KiKi One Round Encryption Mangler Function

Computer Science CSC 405By Dr. Peng Ning46 E Box of DES (Expansion Permutation) How is the E box defined –Each row expands from 4 bits to 6 bits

Computer Science CSC 405By Dr. Peng Ning47 Another View of the Mangler Function S8S1S2S7S3S4S5S Permutation The permutation produces “spread” among the chunks/S-boxes! subkey

Computer Science CSC 405By Dr. Peng Ning48 2 bits row S i i = 1,…8. I1 I2 I3 I4 I5 I6 O1 O2 O3 O4 4 bits column an integer between 0 and 15. S-Box (Substitute and Shrink) 48 bits ==> 32 bits. (8*6 ==> 8 *4) 2 bits used to select amongst 4 permutations for the rest of the 4-bit quantity

Computer Science CSC 405By Dr. Peng Ning49 The First S Box S … Each row and column contain different numbers. Example: input: output: ???

Computer Science CSC 405By Dr. Peng Ning50 DES Standard Cipher Iterative Action –Input:64 bits –Key:48 bits –Output:64 bits Key Generation Box –Input:56 bits –Output:48 bits One round (Total 16 rounds)

Computer Science CSC 405By Dr. Peng Ning51 Avalanche Effect A small change in either the plaintext or the key should produce a significant change in the ciphertext DES has a strong avalanche effect Example –Plaintexts: 0X and 0X –Same key: 0X016B24621C181C32 –34 bits difference in cipher-texts –Similar result with same plaintext and slightly different keys

Computer Science CSC 405By Dr. Peng Ning52 Concerns about DES Key space problem: 56 bit key (2 56 ) –DESCHALL recovered RSA challenge I key on June 17, 1997 (6 month into the contest) –$.25m (total cost), July 15, 1998, RSA DES challenge II key recovered in 56 hours Cryptanalysis –Sixteen weak and semi-weak keys: –Differential cryptanalysis require less tries using chosen plaintext/ciphertext [Biham, 1993] Effective up to 15 rounds DES is well designed to defeat differential analysis –Linear cryptanalysis requires only known plaintext/ciphertext [Matsui, 1993]