Crypto 1
Crypto 1
Crypto 1
Wrgdb’v Wrslfv:
1. Orjlvwlfv:
- Fodvv olvw
- Vboodexv
2. Wkh Pdwk
3. Zkdw lv Fubswrjudskb
4. Vrph Fodvvlfdo Fubswrvbvwhpv
Cryptography
Course number: 4003-482 / 4005-705
Instructor: Ivona Bezáková
Today’s topics:
1. Logistics:
- Class list
- Syllabus
2. The Math
3. What is Cryptography
4. Some Classical Cryptosystems
The Math
We will go beyond descriptions of cryptographic
algorithms and ways how to break them.
Typical scenario:
Alice Bob
Eve
What is Cryptography
Alice Bob
Eve
Symmetric-key cryptosystems:
- private-key cryptosystems use (essentially) the same
key for encryption and decryption
ome Cryptanalysis Terminology
Cryptanalysis
- the process of attempting to compute the key
- the most common attack models:
- ciphertext only attack
- known plaintext attack
- chosen plaintext attack
- chosen ciphertext attack
2. Data integrity
3. Authentication
4. Non-repudiation
lassical Cryptosystems
(Starting Chapter 2, sneaking in some math from Chapter 3.)
Conventions:
- plaintext: lowercase
- CIPHERTEXT: uppercase
- Spaces and punctuations will be usually omitted.
- Letter of the alphabet will be often identifies with
numbers 0,1,…,25.
Monoalphabetic Ciphers
- Each letter is mapped to a unique letter.
- Examples: shift cipher, substitution cipher, affine cipher
Examples: (true/false)
7 ´ 5 (mod 3) 4 ´ 1 (mod 3)
7 ´ 1 (mod 3) -4 ´ -1 (mod 3)
66 ´ 0 (mod 3) -8 ´ 7 (mod 3)
Modular Arithmetic
Let a be an integer, m be a positive integer.
We use:
a mod m
to denote the remainder when a is divided by m. The
remainder is always a number from {0,1,2,…,m-1}.
Examples:
8 mod 3 = 1 mod 1 = 0 mod 2 =
63 mod 7 = -8 mod 3 =
3 mod 6 = -63 mod 7 =
Is % in Java/C/C++ the same as mod ?
Modular Arithmetic
Zm denotes the set {0,1,2,…,m-1}, with two operations:
- addition (modulo m)
- multiplication (modulo m)
How to decrypt ?
x
Remarks:
- For k=3 this is known as the Caesar cipher, attributed to
Julius Caesar.
- Shift cipher works over any Z .
Shift Cipher
How good is it ?
- the good: efficient encryption/decryption computation
- the bad: easy to attack (not very secure)
- how ?
Kerckhoff’s Principle:
- Eve knows the cipher but does not know the key.
- Always assumed in cryptanalysis.
Substitution Cipher
- Monoalphabetic cipher defined by a permutation of the
alphabet.
- Example:
abcdefghijklmnopqrstuvwxyz
ONETWHRFUISXVGABCDJKLMPQYZ
- Exercise:
decode: EDYBKARDOBFY
Substitution Cipher
How good is it ?
- the good: efficient encryption/decryption
- the bad(?): is it secure ?
- approach 1: try all possible keys
- is this feasible ?
- What is ®-1 ?
Affine Ciphers
Questions:
- Efficiently computable encryption and decryption ?