Introduction to Cyber Security
TA 4 part 1 – Intro to Cryptography
Jonathan Berger
Based on slides of Benny Pinkas and Avishay Yanai
Can we guarantee “” while avoiding these limsecurityitations?
2
Computational Security
Two realistic relaxations:
E.g., 200 years using current technology
Small enough such that will essentially never happen
3
The Asymptotic Approach
“A scheme is secure if every probabilistic polynomial-time (PPT) adversary
succeeds in breaking the scheme with only negligible probability”
4
OTP without a zero key
page 5
OTP without a zero key – Intuition + refutation
page 6
OTP without a zero key – A note
page 7
Indistinguishability and Perfect Secrecy
page 8
Proof
page 9
Proof (one direction, perfect secrecy ⇒ indistinguishability)
page 10
Bayes’ theorem
Due to perfect secrecy
Proof (cont.)
page 11
PRG – recall definition
page 12
Pseudo-random generator
Slide from Introduction to Cryptography, Benny Pinkas
u
Distinguisher
D
random
????
G
s
G(s)
seed
(random, |s|=n)
output
|u|= 2n
Deterministic function of s, publicly known
∀ D
|G(s)| = 2n
page 13
Pseudo-random
generator
Pseudorandom Generators (PRGs)
14
G’(s) = ¬G(s) is a PRG (pseudorandomness proof)
Pseudorandom Generator (PRG)
Seed
…
A Reminder - Pseudorandom Function (PRF) - definition
Pseudorandom Function (PRF)
Key
…
Pseudorandom Function (PRF)
Key
F(k,X)
…
Location X
PRF 🡪 PRG?
PRF 🡪 PRG?
…
Encryption
Chosen-Plaintext Security
Modes of Operation
Mode 1: Electronic Codebook (ECB)
ECB mode is not CPA-secure
or
Insecurity of ECB…
Mode 2: Counter Mode (CTR)
Mode 3: Cipher Block Chaining (CBC)
CBC with non-random IV
CBC with non-random IV (cont.)
or
CBC with non-random IV (cont.)
CCA Security
CBC mode is not CCA secure
CTR mode is not CCA secure
AES-CTR mode example in python
Study Case - BEAST Attack
Encryption 1
Encryption 2
New random IV
Study Case - BEAST Attack (cont.)
Encryption 1
Encryption 2
Previous last ciphertext block is used as IV
Study Case - BEAST Attack (cont.)
Some Data
“Password:1456”
We Control
We see
C1
C2
C3
IV = C3
C4
C5
IV = C5
We Control
C6
The Setting
P0
P1
Study Case - BEAST Attack (cont.)
P0
Some Data
“Password:1456”
We Control
We see
C1
C2
C3
IV = C3
C4
C5
IV = C5
We Control
C6
P1
Questions?