CO 487

Fundamental Goals of Cryptography

Symmetric-key cryptography: The client and server share some secret information k, called a key.

Public-key cryptography: Share an authenticated (but not secret) information.

SSL Protocol

  1. Server transmits certificate to client.
  2. Client verifies signature to verify authenticity.
  3. Client selects random key k and encrypts with server’s RSA public key, transmits ciphertext to server.
  4. Server decrpyts ciphertext.

Is SSL really secure?

There are many potential security vulnerabilities.

  1. Crypto is weak (e.g. AES, HMAC, RSA).
  2. Quantum attacks on underlying cryptography.
  3. Weak random number generation.
  4. Fraudulent certificates.
  5. Software bugs (both inadvertent and malicious).
  6. Phishing attacks.
  7. SSL only protects data during transit, does not protect data when it is collected at the server.

Crypto might be strong, but information security is more difficult (cybersecurity).

Symmetric-key Encryption Scheme

Such that D_k(E_k(m)) = m.

  1. Alice and Bob agree on a secret key over a secure channel.
  2. Alice computes c = E_k(m) and sends over the unsecure channel.
  3. Bob retrieves plaintex by computing m = D_k(c).

Why not always use the secure channel? It is commonly slow, inconvenient.

What does security mean for a SKES?

  1. What is the adversary’s goal?
  2. What are the computational powers?
  3. How does the adversary interact with the two communicating parties?

Security model: Defines the computational abilities of the adversary, and how she interacts.

Basic assumption: Adversary knows everything about the SKES, only missing the key k.

Adversary’s Interaction

  1. Passive Attacks.
  2. Active Attacks.

Attacks which are not considered in this course.

Computational Power of Adversary

Adversary’s Goal

  1. Recover the secret key.
  2. Systematically recover plaintext from secret text. May not necessarily need the secret key.
  3. Learn some partial information about the plaintext from the ciphertext.

We want to guard against the strongest attacker going for the weakest goal.

A SKES is said to be secure if it is semantically secure against a chosen-plaintext attack by a computational bounded adversary.

To break a SKES, the attacker needs to do the following.

  1. Given a challenge ciphertext c.
  2. Select plaintexts and obtain corresponding ciphertexts.
  3. After a feasible amount of computation, obtain information about plaintext m corresponding to the challenge ciphertext c.

Work Factor

The Bitcoin network is presently performing hash operations at the rate of 2^{65} per second, 2^{90} per year.

The Laundeur limit from thermodynamics proposes that exhaustively trying 2^{128} symmetric keys would require more power for a year than the world produces.

Security Level

A cryptographic scheme is said to have a security level of l bits if the fastest known attack on the scheme takes approximately 2^l operations. As of 2019, a security level of 128 bits is desirable in practice.

Polyalphabtic Ciphers

Basic Idea. Use several permutations, plaintext encrypted to one of several possible cipher letters.

Example: Vigenere Cipher.

The One-Time Pad

If the key is shorter than the ciphertext, the key should not be re-used.

Stream Ciphers

Use a pseudorandom generator PRBG (Pseudo-Random Bit Generator).

RC4 Stream Cipher

RC4 Key Scheduling Algorithm

K[i], \overline{K}[i], S[i] are bytes.

Input: Secret key K[0], K[1], ..., K[d-1].

Output: 256-long array: S[0], S[1], ..., S[255].

for i in range(256):
    S[i] = i
    K2[i] = K[i % d]
j = 0
for i in range(256):
    j = (K2[i] + S[i] + j) % 256
    S[i], S[j] = S[j], S[i] 

Idea: S is a “random-looking” permutation of \{0, 1, ..., 255\} which is generated from the secret key.

RC4 Keystream Generator

Input: 256-long byte array S[0], S[1], ..., S[255].

Output: Keystream.

i = 0, j = 0
while keystream_bytes_are_required:
    i = (i + 1) % 256
    j = (S[i] + j) % 256
    S[i], S[j] = S[j], S[i]
    t = (S[i] + S[j]) % 256
    output(S[t])

Encryption: Keystream bytes are xored with the plaintext bytes.

Fluhrer-Mantin-Shamir attack exploits known biases in the first few bytes of the keystream. Defeated by discarding the first few bytes.

Because of several new weaknesses, RC4 is no longer used in applications such as SSL. Instead, use AES-CTR.

Wireless Security

More attack opportunities, no physical access. Attackers can be at a distance and leave no physical evidence of attack.

  1. Confidentiality: Prevent against casual eavesdropping.
  2. Data Integrity: Prevent tampering with transmitted messages.
  3. Access Control: Protect access to a wireless network infrastructure.

Mobile stations share a key k with access points. Messages are divided into packets of some fixed length. WEP uses a per-packet 24-bit initialization vector (IV) v to process each packet. v is prepended to the key to generate the keystream.

Question: Are confidentiality, data integrity, and access control achieved?

Since there are only 2^{24} choices for IV, collisions are guaranteed after enough time. If they are selected randomly, then one can expect a collision after 2^{12} packets. This allows attackers to obtain multiple messages with the same v, so they can obtain m_1 \oplus m_2.

It is also easy to make controlled changes to encrypted packets without invalidating the checksum.

Knowledge of one plaintext m corresponding to (v, c) allows an attacker to compute a valid encrypted packet for any plaintext with the same keystream.

Lessons Learned

  1. The devil is in the details. Do not assume that obvious ways of using cryptographic functions are secure.
  2. Attacks only get better over time.
  3. Designing security is hard.
  4. There is a big demand in industry for security engineers.

Block Ciphers

Desirable Properties

Feistel Cipher

Take something fairly simple and repeat.

No restrictions are needed to be placed on f for the encryption to work.

New Data Seal (NDS)

Component function f: \{0, 1\}^{64} \to \{0, 1\}^{64} is complicated.

Complicated, but is it secure?

Chosen-Plaintext Attack on NDS

Given an encryption oracle with respect to Alice’s secret key, we want to find k.

Observation: Let T denote one round of encryption. Let F represent the full encryption function.

T((m_{i-1}, m_i)) = (m_i, m_{i-1}\oplus f(m_i)) F((m_0, m_1)) = (m_16, m_17)

So F = T^{16}. So T(F(m)) = T(T^{16}(m)) = T^{16}(m)T(m) = F(T(m)). \mathbf{F, T} commute.

  1. We select r \in \{0, 1\}^8. We determine k(r) as follows. Select u = (m_0, m_1) such that.
  2. Obtain F(u) = (a, b) from Alice.

Then T(F(u)) = T((a, b)) = (b, ?). Since F, T commute, we have F(T(u)) = (b, ?).

Let’s make a guess for k(r) = t \in \{0, 1\}^8. We apply one round of encryption to u assuming that k(r) = t. Call the result T_t(u). Obtain the encryption of T_t(u) from Alice, F(T_t(u)) = (c, d).

Now, if indeed k(r) = t, then T_t(u) = T(u), so F(T_t(u)) = F(T(u)). So b = c. On the other hand, if k(r) \neq t, then we claim T_t(u) \neq T(u) by the second constraint on the input.

Assuming now that F behaves like a random permutation (heuristic assumption). Then we can assume that F(T_t(u)) is a random bit string of length 128. In particular, the probability that c = b is roughly \frac{1}{2^{64}} which is negligible. So if b \neq c then k(r) \neq t.

Expected Chosen-Plaintexts: 256(1 + 128) \approx 32000.

DES

Component function f_i: \{0, 1\}^{32} \to \{0, 1\}^{32}.

Question: How can one construct a more secure block cipher from DES?

Multiple Encryption. Re-encrypt the ciphertext one or more times using independent keys. Hope that this increases effective key length.

Double Encryption

k = (k_1, k_2) \in_R\{0, 1\}^{56}.

Encryption. c = E_{k_2}(E_{k_1}(m)).

Double-DES key length is l=112, so exhaustive key search is infeasible.

E^{-1}_{k_2}(c) = E_{k_1}(m) which leads to a meet-in-the-middle attack.

Block Cipher Modes of Operation

How should we encrypt blocks?

AES

Widely used today.

Requirements.

Hash Functions

Takes in a message of arbitrary length and outputs fixed length. H is fixed and public.

  1. Preimage Resistance.
  2. 2nd Preimage Resistance.
  3. Collision Resistance.

To show that a hash property is violated, you need to design efficient algorithms for.

  1. PR.
  2. 2PR.
  3. CR.

Relationships Between Properties

Proof-of-Work in Blockchains

Decentralized storage system.

  1. Readable by everyone.
  2. Writeable by everyone.
  3. Unchangeable by anyone.

Mining

Given D_1, D_2, ..., D_t, find a 256-bit string s such that \text{SHA256}(D_1, D_2, ..., D_t, s) begins with 74 zeros. So selecting arbitrary s is expected 2^{74}. Then s is the proof of work.