CRYPTOGRAPHY

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

37 Terms

1
New cards

Cryptography

The study of mathematical techniques for securing digital information, systems, and distributed computations against adversarial attacks.

2
New cards

A private-key encryption scheme is specified by a message space M and three

algorithms:

ˆ Key Generation: KGen is a probabilistic algorithm that outputs a key k according to some

distribution

ˆ Encryption: Enc takes as input a key k and a message m, and outputs a ciphertext c

ˆ Decryption: Dec takes as input a key k and a ciphertext c, and outputs a message m

3
New cards

Kerckhoffs’ Principle

The cipher method must not be required to be secret, and it must be able to fall into the hands of the enemy without inconvenience.

which means key must be the o ly thing that remains secret.

4
New cards

Caesar’s cipher

Letters were shifted 3 places forward.

ROT-13 shift 13 places forward. type of caesar’s cipher.

5
New cards

Problems with Caesar’s Cipher

  • cipher method is fixed;

  • there is no key;

  • fails to achieve Kerckhoffs principle

6
New cards

Shift Cipher

keyed variant of Caesar Cipher.

enc= shift k places forward'

dec= shift k places backward

7
New cards

is shift cipher secure? why or why not?

it is not restitant to brute force attacks

8
New cards

Sufficient Key-Space Principle

Any secure encryption scheme must have a key space that is sufficiently large to make an exhaustive-search attack infeasible

9
New cards

Mono alphabetic substituition

Key is an arbitary mapping of letters in the alphabet, ensuring each letter is consistently replaced by a specific letter throughout the message.

brute force attack is infeasibale due to the vast number of possible key combinations.

10
New cards

Is mono alphabetic substituition secure?

Attack possible using statistical properties of the English language

11
New cards

shift attack

compute Ij for all j and output the value k for

which Ik is closest to 0.065

<p>compute Ij for all j and output the value k for</p><p>which Ik is closest to 0.065</p>
12
New cards

vigenere

Key is a string of letters,

brute force prob

statistical approach works

13
New cards

vignere attack

unknown key lentgh is ok

14
New cards

Kasiski’s method

  • indentify repeated pattern of length 3 in the ciphertext

  • Greatest common divisor of the distance between repeated sequences will yield the key length

    (or a multiple of it)

15
New cards

Index of coincedonce

knowt flashcard image
16
New cards

security definitions’ two components:

1. A security guarantee (from view of the attacker an attacker’s goal that constitutes a break

of the scheme)

2. A threat model (describing what the adversary is capable of)

17
New cards

attackers’ goal

a ciphertext should leak no additional information about the underlying plaintext

18
New cards

threat models

  • Ciphertext-only attack: The adversary just observes ciphertexts. This is the threat model we have been implicitly assuming thus far

  • Known-plaintext attack: The adversary can learn some plaintext-ciphertext pairs and aims to deduce information of a plaintext underlying some other ciphertext

  • Chosen-plaintext attack: The adversary can obtain plaintext-ciphertext pairs, as above, for plaintexts of its choice

  • Chosen-ciphertext attack: The adversary is additionally able to obtain the decryption of ciphertexts of its choice

19
New cards

Principles of Modern Cryptography

  1. definitions

  2. precise assumptions

  3. proofs of security

20
New cards

An encryption scheme is defined by?

three algorithms KGen, Enc, and Dec, as well as a specification of a message space M with |M| > 12, a (finite) key space K, and a ciphertext space C

21
New cards

perfect correctness?

for all k ∈ K and m ∈M, we have:

Pr[Dec(k, Enc(k,m)) = m] = 1

Perfect correctness implies that decryption is deterministic (without loss of generality), as Dec(k, c) must return the same output every time

22
New cards

Perfect Secrecy?

“Regardless of any prior information the attacker has about the plaintext, the ciphertext should leak no additional information about the plaintext”

For every m,m′ ∈M, and every c ∈ C, we have

Pr[Enc(k,m) = c] = Pr[Enc(k,m′) = c].

<p>“Regardless of any prior information the attacker has about the plaintext, the ciphertext should leak no additional information about the plaintext”</p><p>For every m,m′ ∈M, and every c ∈ C, we have</p><p>Pr[Enc(k,m) = c] = Pr[Enc(k,m′) = c].</p>
23
New cards

perfectly indistinguishable

if perf indist=> perf secret

<p>if perf indist=&gt; perf secret</p>
24
New cards

One Time Pad

is perf secret

<p>is perf secret</p>
25
New cards

Limitations of the OTP?

ˆ key is as long as the message

ˆ only secure if the key is used once

26
New cards

perf secret encyrytion when?

Theorem 2.11

If (KGen, Enc, Dec) is a perfectly secret encryption scheme with message space M and key space K, then |K| ≥ |M|.

27
New cards

Shannon theorem

<p></p>
28
New cards

Message Integrity In block vs stream

Stream: flipping 1 bit results in whole message change

block: flipping one only affects that bit

29
New cards

MAC Defin?

A message authentication code (or MAC) consis of three probabilistic polynomial-time algorithms (KGen, Mac, Vrfy) such that:

1. The key-generation algorithm KGen takes as input the security parameter 1n and outputs a key k with |k| ≥ n.

2. The tag-generation algorithm Mac and a message m ∈ {0, 1}∗, and outputs a tag t. Since this algorithm may be randomized, we write this as t ← Mack (m).

3. The deterministic verification algorithm Vrfy takes as input a key k, a message m, and a tag t. It outputs a bit b, with b = 1 meaning valid and b = 0 meaning invalid. We write this as b := Vrfyk (m, t).

It is required that for every n, every key k output by KGen(1n), and every m ∈ {0, 1}∗, it holds that Vrfyk (m, Mack (m)) = 1.

If there is a function ℓ such that for every key k output by KGen(1n), algorithm Mack is only defined for messages m ∈ {0, 1}ℓ(n), then we call the scheme a fixed-length MAC for messages of length ℓ(n).

30
New cards

The adversarial indistinguishability experiment Mac-ForgeA,Π(n):

1. A key k is generated by running KGen(1n).

2. The adversary A is given input 1n and oracle access to Mack (·). The adversary eventually outputs (m, t). Let Q denote the set of all queries that A submitted to its oracle.

3. A succeeds if and only if

(1) Vrfy(k,m, t) = 1 and

(2) m /∈ Q.

In that case the output of the experiment is defined to be 1.

A message authentication code Π = (KGen, Mac, Vrfy) is existentially unforgeable under an adaptive chosen-message attack, or just secure, if for all probabilistic polynomial-time adversaries A there is a negligible function negl such that

Pr[Mac-ForgeA,Π(n) = 1] ≤ negl(n) .

31
New cards

Replay Attacks

an adversary sends again (“replays”) previously authenticated messages.

Prevention: use timestamps

32
New cards

Mac -s Forge

define the experiment Mac-sForgeA,Π similar to Mac-ForgeA,Π with the difference that Q stores pairs of oracle queries and responses and the final check is modified to (m, t) /∈ Q, for (m, t) the output of A

A message authentication code Π = (KGen, Mac, Vrfy) is strongly secure, if for all probabilistic polynomial-time adversaries A there is a negligible function negl such that

Pr[Mac-sForgeA,Π(n) = 1] ≤ negl(n) .

33
New cards

Macs Pseudorandom Fnc

Limitation of Construction 4.5: only messages of fixed-length can be handled, which is unacceptable for most applications

<p>Limitation of Construction 4.5: only messages of fixed-length can be handled, which is unacceptable for most applications</p>
34
New cards

Secure Message Authentication Codes

add a random “message identifier” r in each block to prevent the“mix-and-match” attack

Let Π′ = (Mac′, Vrfy) be a fixed-length MAC for messages of length n. Define a MAC as

follows:

ˆ Mac: on input a key k ∈ {0, 1}n and a message m ∈ {0, 1}∗ of (nonzero) length ℓ < 2n/4, parse m as d blocks m1, . . . ,md , each of length n/4. (The final block is padded with 0s if necessary.) Choose a uniform message identifier r ∈ {0, 1}n/4.

For i = 1, . . . , d, compute ti ← Mac′ k (r ∥ ℓ ∥ i ∥ mi ), where i , ℓ are encoded as strings of length n/4. Output the tag t := ⟨r , t1, . . . , td ⟩.

ˆ Vrfy: on input a key k ∈ {0, 1}n, a message m ∈ {0, 1}∗ of nonzero length ℓ < 2n/4, and a tag t := ⟨r , t1, . . . , td′ ⟩, parse m as d blocks m1, . . . ,md , each of length n/4. (The final block is padded with 0s if necessary.) Output 1 if and only if d′ = d and Vrfy′ k (r ∥ ℓ ∥ i ∥ mi , ti ) = 1 for 1 ≤ i ≤ d.

<p>add a random “message identifier” r in each block to prevent the“mix-and-match” attack</p><p></p><p>Let Π′ = (Mac′, Vrfy) be a fixed-length MAC for messages of length n. Define a MAC as</p><p>follows:</p><p>ˆ Mac: on input a key k ∈ {0, 1}n and a message m ∈ {0, 1}∗ of (nonzero) length ℓ &lt; 2n/4, parse m as d blocks m1, . . . ,md , each of length n/4. (The final block is padded with 0s if necessary.) Choose a uniform message identifier r ∈ {0, 1}n/4.</p><p>For i = 1, . . . , d, compute ti ← Mac′ k (r ∥ ℓ ∥ i ∥ mi ), where i , ℓ are encoded as strings of length n/4. Output the tag t := ⟨r , t1, . . . , td ⟩.</p><p></p><p>ˆ Vrfy: on input a key k ∈ {0, 1}n, a message m ∈ {0, 1}∗ of nonzero length ℓ &lt; 2n/4, and a tag t := ⟨r , t1, . . . , td′ ⟩, parse m as d blocks m1, . . . ,md , each of length n/4. (The final block is padded with 0s if necessary.) Output 1 if and only if d′ = d and Vrfy′ k (r ∥ ℓ ∥ i ∥ mi , ti ) = 1 for 1 ≤ i ≤ d.</p>
35
New cards

CBC-MAC

Let F be a pseudorandom function, and fix a length function ℓ(n) > 0. The basis CBC-MAC construction is as follows:

ˆ Mac: on input a key k ∈ {0, 1}n and a message m of length ℓ(n) · n, do the following (set ℓ = ℓ(n) in what follows):

1. Parse m and m = m1, . . . ,mℓ where each mi is of length n.

2. Set t0 := 0n. Then, for i = 1 to ℓ, set ti := Fk (ti−1 ⊕ mi )

Output tℓ as the tag.

ˆ Vrfy: on input a key k ∈ {0, 1}n, a message m, and a tag t, do: If m is not of length ℓ(n) · n then output 0. Otherwise, output 1 if and only if t ?= Mack (m).

Theorem 4.10

Let ℓ be a polynomial. If F is a pseudorandom function, then Construction 4.9 is a secure MAC for messages of length ℓ(n) · n.

<p>Let F be a pseudorandom function, and fix a length function ℓ(n) &gt; 0. The basis CBC-MAC construction is as follows:</p><p>ˆ Mac: on input a key k ∈ {0, 1}n and a message m of length ℓ(n) · n, do the following (set ℓ = ℓ(n) in what follows):</p><p>1. Parse m and m = m1, . . . ,mℓ where each mi is of length n.</p><p>2. Set t0 := 0<sup>n</sup>. Then, for i = 1 to ℓ, set ti := F<sub>k</sub> (ti−1 ⊕ mi )</p><p>Output tℓ as the tag.</p><p></p><p>ˆ Vrfy: on input a key k ∈ {0, 1}n, a message m, and a tag t, do: If m is not of length ℓ(n) · n then output 0. Otherwise, output 1 if and only if t ?= Mac<sub>k</sub> (m).</p><p></p><p>Theorem 4.10</p><p>Let ℓ be a polynomial. If F is a pseudorandom function, then Construction 4.9 is a secure MAC for messages of length ℓ(n) · n.</p>
36
New cards

Basic CBC-MAC vs. Construction 4.5 and Construction 4.7

Compared to Construction 4.5, basic CBC-MAC can handle longer messages (though still fixed-length)

Compared to Construction 4.7, basic CBC-MAC is much more efficient: only d block-cipher evaluations for a message of length dn and a tag of length n (compared to 4d block cipher evaluations and tags of length more than 4dn)

37
New cards

CBC-MAC vs. CBC-mode encryption

Basic CBC-MAC is similar to the CBC mode of operation but there are crucial differences:

1. CBC-mode encryption uses a random IV, which is crucial for security. CBC-MAC uses no IV (can be viewed as constant IV iv = 0n), which is also crucial for security.

2. In CBC-mode encryption the intermediate values (ti in CBC-MAC) are output as part of the ciphertext. CBC-MAC only outputs the final value tℓ.