Download presentation
Presentation is loading. Please wait.
Published byEmerald Annice Harvey Modified over 8 years ago
1
Feb 17, 2003Mårten Trolin1 Previous lecture Practical things about the course. Example of cryptosystem — substitution cipher. Symmetric vs. asymmetric cryptography. RSA — keys, encryption, decryption. (Proof of correctness not part of course.)
2
Feb 17, 2003Mårten Trolin2 This lecture Block ciphers Modes of operations First assignment Hash functions
3
Feb 17, 2003Mårten Trolin3 Block ciphers A block cipher B is an encryption function E key :{0,1} k {0,1} l and a decryption function D key :{0,1} l {0,1} k such that D key (E key (m)) = m. The value k is called block length. Usually k = l. Commonly used block ciphers include DES, 3DES and IDEA. Clear (plain) textCipher text Key
4
Feb 17, 2003Mårten Trolin4 Chaining ciphers What happens when the clear text is longer than the block length k? Most simple solution — encrypt each block separately. This mode is called ECB, Electronic Code Book Clear text Cipher text Enc Key
5
Feb 17, 2003Mårten Trolin5 Problems with ECB The main problem with ECB is that an adversary can change order or remove blocks without detection. The solution — link the encrypted blocks to each other. Most common option — Cipher Block Chaining, CBC
6
Feb 17, 2003Mårten Trolin6 Cipher Block Chaining A feedback is introduced to link the blocks together Clear text Cipher text Enc Key IV
7
Feb 17, 2003Mårten Trolin7 Cipher Block Chaining, cont. Let E key be the encryption function, D key be the decryption function, P i block i of the clear text and C i block i of the cipher text, i = 1, 2, 3... Encryption of block i: C i = E key (P i C i-1 ) where C 0 = IV (initialization vector) Decryption of block i: P i = C i-1 D key (C i ) The Initialization Vector, IV = C 0, must be known to both parties and can be sent in clear.
8
Feb 17, 2003Mårten Trolin8 First assignment Implement encryption and decryption using your favourite block cipher (DES, 3DES, IDEA etc) for two modes (e.g., ECB and CBC) with a usable (not necessarily user-friendly!) command-line interface. Use an existing crypto library for the block cipher, but implement the chaining yourself! Examples of possible crypto libraries to use: openssl (for C) or JSSE (for Java). You can get a maximum of 20 points for the exam from this assignment.
9
Feb 17, 2003Mårten Trolin9 Rules for the assignment Choose your favourite language! –If you pick another language than C, C++, Pascal or Java, or another platform than UNIX/Linux or Windows/DOS, please contact me first! Solve the assignment either individually or in pairs. Hand in the solution no later than March 5 th. You lose one point per day if you hand in late. You can hand in your solution –By email to marten@nada.kth.se. –On a diskette at the lecture –As a link to a site that I can reach
10
Feb 17, 2003Mårten Trolin10 Rules for the assignment, cont. Please include –source code –executable –a brief description of the interface (just enough so that I can run it) –contact information –the amount of time you spent on the assignment (not used for grading, just to tune the difficulty of the assignments)
11
Feb 17, 2003Mårten Trolin11 Rules for the assignment, cont. Co-operation between groups is allowed only on a conceptual level –Example of things you may discuss: Is it easier to solve the assignment in Java than C? What is a good format to provide the key? Is this input format reasonable? –Example of things you may not discuss: Please show me your code so I can copy part of it! Please state the persons you have discussed the solution with. You may be asked to explain your solution orally.
12
Feb 17, 2003Mårten Trolin12 Hash functions A hash function computes a fixed length value from a variable length source –Example: Check sums in communication protocols –Indices in databases More convenient to handle a hash of a document instead of the document itself We will consider cryptographically secure hash functions.
13
Feb 17, 2003Mårten Trolin13 Hash functions, definition A hash function is a function f:{0,1}* {0,1} n. The size of the output, n, is a property of the function. Common values are 128, 160 and 256. Commonly used hash functions are MD5, SHA and SHA-1
14
Feb 17, 2003Mårten Trolin14 Hash function — examples f(m) = first 40 bits of m f(m) = last 40 bits of m f(m) = XOR of the bytes of m
15
Feb 17, 2003Mårten Trolin15 Properties of good hash functions Let H be a hash function One-way –Given x, unfeasible to compute an v such that H(v) = x Collision-free –Unfeasible to find x 1 and x 2 such that H(x 1 ) = H(x 2 ) and x 1 x 2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.