Prof. Reuven Aviv, Nov 2013 Public Key Infrastructure1 Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Problem Set 1: Cryptography.

Slides:



Advertisements
Similar presentations
Chapter 3 Public Key Cryptography and Message authentication.
Advertisements

Computer Security Set of slides 4 Dr Alexei Vernitski.
RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
“Advanced Encryption Standard” & “Modes of Operation”
Modern Symmetric-Key Ciphers
Modern Symmetric-Key Ciphers
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
1 Lecture 3: Secret Key Cryptography Outline concepts DES IDEA AES.
1 Cryptanalysis-tolerant CPA crypt. ● Suppose E, E’ are two encryption schemes which on of them is CPA - secure  E.g., a standard and a proprietary, a.
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Session 4 Asymmetric ciphers.
Cryptography1 CPSC 3730 Cryptography Chapter 6 Triple DES, Block Cipher Modes of Operation.
ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS Cryptographic Security.
Chapter 5 Cryptography Protecting principals communication in systems.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
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.
ITIS 3200: Introduction to Information Security and Privacy Dr. Weichao Wang.
Csci5233 Computer Security & Integrity 1 Cryptography: Basics (2)
McGraw-Hill©The McGraw-Hill Companies, Inc., Security PART VII.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
8: Network Security8-1 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key: K r e.g., key is knowing substitution.
Chapter 13: Electronic Commerce and Information Security Invitation to Computer Science, C++ Version, Fourth Edition SP09: Contains security section (13.4)
Chapter 8.  Cryptography is the science of keeping information secure in terms of confidentiality and integrity.  Cryptography is also referred to as.
Codes, Ciphers, and Cryptography-RSA Encryption
Public Key Model 8. Cryptography part 2.
Chapter 12 Cryptography (slides edited by Erin Chambers)
Block Cipher Transmission Modes CSCI 5857: Encoding and Encryption.
Lecture 23 Cryptography CPE 401 / 601 Computer Network Systems Slides are modified from Jim Kurose & Keith Ross.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 9: Cryptography.
A Cryptography Education Tool Anna Yu Department of Computer Science College of Engineering North Carolina A&T State University June 18, 2009.
Cryptography and Network Security Chapter 6. Multiple Encryption & DES  clear a replacement for DES was needed theoretical attacks that can break it.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Public-Key Cryptography CS110 Fall Conventional Encryption.
TE/CS 536 Network Security Spring 2006 – Lectures 6&7 Secret Key Cryptography.
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.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Day 37 8: Network Security8-1. 8: Network Security8-2 Symmetric key cryptography symmetric key crypto: Bob and Alice share know same (symmetric) key:
Cryptography Wei Wu. Internet Threat Model Client Network Not trusted!!
Section 4.4: The RSA Cryptosystem Practice HW Handwritten and Maple Exercises p at end of class notes.
Multiple Encryption & DES  clearly a replacement for DES was needed Vulnerable to brute-force key search attacks Vulnerable to brute-force key search.
More About DES Cryptography and Network Security Reference: Sec 3.1 of Stallings Text.
Dr. Reuven Aviv, Nov 2008 Conventional Encryption 1 Conventional Encryption & Message Confidentiality Acknowledgements for slides Henric Johnson Blekinge.
CSIT311: Spring 2010 Network Management and Security Ghulam Murtaza.
Modes of Operation INSTRUCTOR: DANIA ALOMAR. Modes of Operation A block cipher can be used in various methods for data encryption and decryption; these.
Stream Ciphers and Block Ciphers A stream cipher is one that encrypts a digital data stream one bit or one byte at a time. Examples of classical stream.
Network Security – Special Topic on Skype Security.
Lecture 2: Introduction to Cryptography
24-Nov-15Security Cryptography Cryptography is the science and art of transforming messages to make them secure and immune to attacks. It involves plaintext,
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Homework #1 J. H. Wang Oct. 2, 2013.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Cipher Transmission and Storage Modes Part 2: Stream Cipher Modes CSCI 5857: Encoding and Encryption.
Homework #2 J. H. Wang Oct. 31, 2012.
Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Public Key Cryptography and Message Authentication (Slides adopted from Stallings,
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
CS480 Cryptography and Information Security
Taehyung Kim HPC Lab. POSTECH
Chapter 30 Cryptography Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Outline Desirable characteristics of ciphers Stream and block ciphers
PART VII Security.
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
RC4 RC
Chapter -4 STREAM CIPHERS
Florida State University
Secret-Key Encryption
Presentation transcript:

Prof. Reuven Aviv, Nov 2013 Public Key Infrastructure1 Prof. Reuven Aviv Tel Hai Academic College Department of Computer Science Problem Set 1: Cryptography

Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI2 Problem 203 In DES: For a bit M, Let M' be the bitwise complement of M. Prove that : If Y = DES K (X) Then Y' = DES K' (X' ) Hint : Begin by showing that for any two bit strings of equal length, A and B, (A  B)' = A'  B (A’  B’) = A  B

Answer 203: DES Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI3

Answer 203: DES Single round L i = R i-1 R i = L i-1  F(R i-1,K i ) F(R i-1,K i ) a complex function: –Input R i-1 –Permutation/expansion (32 bit  48 bits) Using ”E Tables” –XOR with K i (48 bits) –Substitution/choice (48 bits  32 bits) Using 8 ”S boxs”, each 6 bits  4 bits –Permutation P Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI4

Answer 203 First show (A  B)' = A'  B, (A  B) = A’  B’, Now Consider 1 st round of DES K' (X' ) All bits in RE 0 are complemented. Then we call F. F has all kinds of permutations and expansions, and a XOR, with complemented K. Hence the result up to this point is the same as in DES K (X) Then The result is XORed again with complemented K. The result of 1 st round is complemented relative to the result of DES K (X). Similarly for all rounds 5

Problem 205 Consider a CFB mode, with 1 character data and 8 characters register. If a bit error occurs in the transmission of a ciphertext character, how far, in the decryption process, does the error propagate? Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI6

Answer 205: Cipher Feedback Mode - Decryption C 1 = P 1  MSB s (E K (R 1 ))  P 1 = C 1  MSB s (E K ( R 1 )) C 2 = P 2  MSB s (E K (R 2 ))  P 2 = C 2  MSB s (E K ( R 2 )) C n = P n  MSB s (E K (R n ))  P n = C n  MSB s (E K ( R n )) Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI7

Answer 205 Each character (8 bits) is a block The register R has 8 chars (64 bits) Suppose There was an error in C1 (cipher of char 1) P 1 = C 1  MSB s (E K (R 1 )). P1 is obviously affected –Register R2 now has 8 bits with possible error P 2 = C 2  MSB s (E K (R 2 )) is possibly affected The 8 bits with possible errors will not completely removed from the register until the next eight plaintext characters are calculated. Nine plaintext characters are affected. 8

Problem 207 Suppose that someone suggested the following way to confirm that the two of you are both in possession of the same secret key. You create a random bit string the length of the key, XOR it with the key, and send the results over the channel. Your partner XORs the incoming block with the key he knows, sends the result back to you. You check and if what you receive is your original random string, you have verified that your partner has the same secret key, yet neither of you has ever transmitted the key. Is there a flaw in this scheme? Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI9

Answer 207 The algorithm indeed proves that your partner and you are using the same key. But an attacker can get be in the middle, and get the two messages sent. The first message is an XOR of the original random string, with the Key. The second string is the original random string (if your partner indeed knows the key). Thus all the attacker has to do is to XOR the two messages to get the Key. Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI10

Problem 211 What RC4 key K will leave S unchanged during initialization? That is. After the initial permutation of S, the entries of S will be equal to the values from 0 to through 255 in ascending order? Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI11

Answer 211 The initial permutation of S is calculated by assigning to each index i to another index j(i) by j(i) = (j(i-1) +S[i] + T[i]) mod 256, then swap S[i] and S[j]. Initial value of j is 0. Since all values of S[i] are different, a permutation that leaves S unchanged requires j(i) = i for all i. We need to find the key K that will do that: The temporary vector T has the values of K (if K is smaller than T, then K repeats in T) i= 0: we have: j(0) = (0 + S[0] + T[0]) mod 256 = = T[0]mod 256 = K[0]mod256 We require j(0) = i = 0; hence K[0]mode 256 = 0; K[0] = 0

i = 1: j(1) = (j(0) + S[1] + K[1]) mod 256 = (K[1] + 1)mode 256; We require j(1) = i = 1;hence ( K[1] +1)mod256 = 1; K[1] = 0 i = 2: j(2) = (j(1) +S[2] +K[2])mod 256 = (3 + K[2])mod 256. We require j(2) = i = 2; hence (K[2] +3)mod256 = 2; K[2] = 255 i = 3: j(3) = (j(2) + S[3] + K[3])mod256 = (5 + K[3])mod256. We require j(3) = i = 3; hence (K[3] + 5) mode256 = 3; K[3] = 254 Similarly for the rest of the Bytes of the key. 13

Problem 308 Suppose we are attackers. We have a set of blocks encoded with the RSA algorithm and but we obviously don’t know the private key. We know the public key, {n = pq, e}. Suppose also someone tells us they know one of the plaintext blocks (we call it the special block, but we don't know which one) has a common factor with n. Does this helps us in any way to find p and q? Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI14

Answer 308 The encoded special block will also have a common factor with n. Since n = pq, & both p and q are primes, the common factor is either p or q. The plaintext (and the ciphertext) of the special block is a multiple of either p or q. Test each ciphertext for primality. If it is a prime, it’s either p or q. divide it into n to find the other If the cipher is not prime, factor it and check if either of the factors is also a factor of n. If none of them is a factor, go to the next cipher. Eventually we find p and q. 15

Problem 311 Assume the hash of a 2-block message (B1,B2) is RSAH(B1,B2) = RSA(RSA(B1)  B2) After calculating the hash of the message, it is attached to the (un-encrypted) message and sent to a receiver. An opponent catches a two block message (B1,B2) and its hash RSAH(B1,B2). The opponent picks an arbitrary block C1. Show that the opponent can easily construct another block C2 so that the hash of the 2-block message (C1,C2) is equal to the hash of the original 2-block message (B1,B2). 16

Answer 311 The opponent has the 2-block message (B1, B2) and its hash RSAH(B1, B2). The opponent picks an arbitrary block C1 and then constructed a second block C2 by: C2 = RSA(C1)  RSA(B1)  B2 Then: RSA(C1)  C2 = RSA(C1)  [RSA(C1)  RSA(B1)  B2] = RSA(B1)  B2 So RSAH(C1, C2) = RSA[RSA(C1)  C2] = RSA[RSA(B1)  B2] = RSAH(B1, B2) 17

Problem 318 Suppose Alice sends a message to Bob by representing each alphabetic character by as an integer between 0 and 25 (A  0, B  1, … Z  25), and then encrypting each number separately using RSA with large e and large n. Is this method secure? If not explain why. Describe the most efficient attack against this encryption method. Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI18

Answer 318 A plaintext M is a set of blocks, each one is an element of the set {0, 1, 2, …, 25}. Very few different blocks Similarly, a ciphertext C is a set of blocks, each is an element of the set = {0 e mod n, 1 e mod n, …, 25 e mod n}. Very few different ciphers. These can be computed by everybody with the knowledge of the public key of Bob, e, and n. Thus, a man in the middle computes M e mod n for all possible values of M, then create a lookup table with a ciphertext as an index and the corresponding plaintext as a value of the appropriate location in the table. Prof. Reuven Aviv, Nov 2006 Public Key Cryptography and PKI19