Can be transmitted with
the message but must
be unpredictable.
Encryption
Cipher Block Chaining (CBC)
Decryption
plaintext
key
ciphertext
+
+
+
IV
Error Recovery
•
An error in ciphertext affects one block and
several bits of plaintext
key
ciphertext
plaintext
+
+
Error extension
Potential Problems With CBC
•
Mallory can:
–
Add blocks
–
Drop blocks
–
Introduce bit errors
•
Bit loss/addition is not recoverable
Public Key Cryptography
•
Everyone has two keys:
–
Public key K1 that everyone knows
–
Private key K2 that only he knows
–
Encryption algorithm and key properties ensure that
M
M
E
D
K
K
))
(
(
1
2
Modular Arithmetic
•
Galois Field GF(n)
–
All operations are on numbers 0,…n1
•
Observe all operations in Galois Field GF(n)
–
a
=
b
mod
n
if
k, a
=
k*n
+
b
e.g. 26 mod 16 = 10 so
26
= 10
mod
16
–
Modulo operation (modular reduction) can
be performed at any point, e.g.
(a
b) mod n
((a mod n)
(b mod n)) mod n
Modular Exponentiation
•
Key step in asymmetric crypto
•
How many operations are needed to calculate
a
x
?
•
Exponentiation can be performed very efficiently
(
addition chaining
):
–
We want to calculate
a
x
mod
n
–
Write
x
as a binary number,
result=1
–
Traverse
x
from left to right
•
If digit is 1, result=result
2
*a
•
If digit is 0, result=result
2
•
Perform modular reduction often to keep result small. This
is cheap if
n
=2
m
Example
9
23
mod
676
23
mod
4
*
13
result
:
1
is
bit
step5
13
23
mod
36
23
mod
4
*
3
result
:
1
is
bit
step4
3
23
mod
256
23
mod
16
result
:
0
is
bit
step3
16
23
mod
4
result
:
0
is
bit
step2
4
4
*
1
result
:
1
is
bit
step1
23
mod
4
10011
19
23
mod
4
2
2
2
2
2
19
19
Prime Numbers
•
A number
n
is
prime
if it is only divisible by 1
and itself
•
Numbers
x
and
y
are
relatively prime
if they
share no factors greater than 1
–
E.g. 7 and 15 are relatively prime, 9 and 15 are
not because they have 3 as common factor
Inverses Modulo a Number
•
Multiplicative inverse
y
for
x
is a number that
satisfies:
•
In GF(n) inverse
y
for
x
modulo
n
is a number that
satisfies:
•
Inverse
y
in GF(
n
) can be found uniquely if
x
and
n
are relatively prime, otherwise it cannot be found
•
If
n
is prime then it is relatively prime to all
numbers {
0, n1
}
and each number has its inverse
in GF(n)
x and y will be our public/private
key pair
1
y
*
x
1
n
mod
y
*
x
Extended Euclidean Algorithm
•
How to find an inverse
y
for
x
mod
n
•
Extended Euclidean algorithm will find
y
and
k
given
x
and
n
Generate one key starting from
the other (e.g., have public key,
generate private key)
1
n
*
k

y
*
x
n
*
k
1
y
*
x
1
n
mod
y
*
x
Factorization of Large Numbers
•
We have seen that exponentiation in GF(
n
) can
be performed efficiently
•
On the other hand, it is hard to factor large
numbers (find possible
x
and
y
, given
x*y
)
–
Computationally intensive,
must use bruteforce search
•
Generally factoring time of a large number
n
increases exponentially with each binary digit
added to
n
RSA Algorithm
•
Created by Ron Rivest, Adi Shamir,
sand Leonard Adleman
•
Choose two prime numbers
p
and
q
of equal
length
•
Compute
n=p*q
, and
Euler Totient function
(n)=
(p1)*(q1)
–
We will work in GF(n)
•
Choose public key
e
relatively prime to
(
n
)
You've reached the end of your free preview.
Want to read all 55 pages?
 Spring '17
 Cryptography, Alice, Plaintext, Eve, Block cipher example, • Mallory