Previous lecture - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Previous lecture

Description:

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 ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 16
Provided by: mortens
Category:

less

Transcript and Presenter's Notes

Title: Previous lecture


1
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
This lecture
  • Block ciphers
  • Modes of operations
  • First assignment
  • Hash functions

3
Block ciphers
  • A block cipher B is an encryption function
    Ekey0,1k ? 0,1l and a decryption function
    Dkey0,1l ? 0,1k such that Dkey(Ekey(m)) m.
  • The value k is called block length. Usually k
    l.
  • Commonly used block ciphers include DES, 3DES and
    IDEA.

Clear (plain) text
Cipher text
Key
4
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
Enc
Enc
Enc
Enc
Key
Cipher text
5
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
Cipher Block Chaining
  • A feedback is introduced to link the blocks
    together

Clear text
IV
Enc
Enc
Enc
Enc
Key
Cipher text
7
Cipher Block Chaining, cont.
  • Let Ekey be the encryption function, Dkey be the
    decryption function, Pi block i of the clear text
    and Ci block i of the cipher text, i 1, 2, 3...
  • Encryption of block i Ci Ekey(Pi ? Ci-1) where
    C0 IV (initialization vector)
  • Decryption of block i Pi Ci-1 ? Dkey(Ci)
  • The Initialization Vector, IV C0, must be known
    to both parties and can be sent in clear.

8
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
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 5th. You
    lose one point per day if you hand in late. You
    can hand in your solution
  • By email to marten_at_nada.kth.se.
  • On a diskette at the lecture
  • As a link to a site that I can reach

10
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
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
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
Hash functions, definition
  • A hash function is a function f0,1 ? 0,1n.
  • 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
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
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 x1 and x2 such that H(x1)
    H(x2) and x1 ? x2
Write a Comment
User Comments (0)
About PowerShow.com