Chapter 2 - Cryptography Flashcards

1
Q

What does Cryptography help ensure? (4)

A

Ensures
1. Confidentiality: only authorized people can read information
2. Authentication: Verifies sender’s identity
3. Integrity: Protect data from unauthorized modification
4. Anonymity: Hides user identities during communication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two basic operations in cryptography?

A
  1. Encryption: Convert plaintext into ciphertext
  2. Decryption: Convert ciphertext back to plaintext
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a cipher?

A

Algorithm used to encrypt and decrypt data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a key in cryptography?

A

A piece of information that works with the cipher to encrypt and decrypt messages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the Caesar Cipher?

A

Substitution cipher where each letter is shifted by a fixed number of positions

Ex: A becomes D (shift of 3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can the Caesar Cipher be attacked?

A
  1. Brute Force: Trying all possible keys until intelligible plaintext is obtained
  2. Cryptoanalysis: Using letter frequency analysis
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is symmetric key encryption?

A

Encryption where the same key is used for both encrypting and decrypting data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the key distribution problem?

A

If both sender and reciever use the same key then how do you share the key without someone intercepting it?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the requirements for secure symmetric encryption?

A
  1. A strong encryption algorithm
  2. Secure key exchange and storage

Can’t deciper ciphertext even if opponent knows it and has access to one or more ciphertexts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are common attacks on symmetric encryption?

A

Brute Force and Cryptoanalysis (exploit algorithm weaknesses)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Examples of symmetric encryption algorithms

A
  1. DES: Weak and outdated (56-bit key)
  2. 3DES: Encrypt 3 times with DES (stronger but slower)
  3. AES: Fast and secure (128, 192 or 256 bit keys)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between block and stream ciphers?

A

Block: Encrypt data in fixed-size blocks (AES) (can resuse keys)
Stream: Encrypt byte by byte, faster and lightweight (use less code)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When to use block vs stream ciphers

A

stream for data communications channel

block for file transfer, email and database

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is encryption alone not good enough for authentication? Give an example

A

An attacker can reorder blocks

Time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When might we authenticate messages but not encrypt them?

A
  • Broadcast messages (alarm)
  • One side is overloaded and can’t afford to decrypt all incoming messages
  • Computer programs that don’t want to decrypt evey time they need to execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a Message Authentication Code (MAC)?

A

Short piece of data that verifies the authenticity (who) and integrity (unchanged) of a message

Uses a key and a MAC algorithm

message + key as inputs, MAC as ouput that gets added to end of message

both message and MAC transmitted in clear on network, recipient verifies with key that they also have and message as inputs

17
Q

HMAC

A

Standard approach for a keyed hash mac

18
Q

One-Way Hash Function Role

A

Alternative to the message authentication code that does not take a secret key as input for the function

Disclaimer: You can encrypt/decrypt the hashed message for authentication, as we see in diagrams a and b (as authentication method that benefits from using much smaller value than entire message), but the actual hash function just recieves message as input

19
Q

3 ways a message can be authenticated using a hash function

A

a) symmetric encryption
b) public key encryption
c) secret value (keyed hash mac)

20
Q

Steps in keyed hashed MAC

A
  1. Concatenate key before and after message
  2. Hash this and add to end of message
  3. Send both in clear
  4. Recipient who knows key concatenates (prefix and suffix), hashes it, and compares
21
Q

Example of MAC use

A

When you make a payment online, the bank can use HMAC to verify that the payment details weren’t altered during transmission.

22
Q

One-way hash vs MAC

A

An alternative to message authentication code (MAC) that DOES NOT take a secret key as input

23
Q

Why are hash values efficient?

A

Instead of comparing large amounts of data for verification, systems compare smaller fixed size hash values

24
Q

What are the 6 properties of secure hash functions?

A
  1. Any size input
  2. Fixed-size output
  3. Easy to compute
  4. One-way (preimage resistant) Starting with hash, can’t find it’s input
  5. Second preimage resistant Starting with known input and hash, can’t find another input with the same hash
  6. Collision resistant can’t find two inputs with same hash

second preimage like collision with headstart-at u least know one input

25
Q

What is public-key encryption?

A

Encryption method using two keys:
1. Public Key: Available to everyone
2. Private Key: Kept secret
Encryption with one key can only be decrypted with the other

26
Q

Why is public-key available to everyone?

A

So anyone can send an encrypted message for the key owner. (secure communication for parties who have never met)

Let others know how to encrypt a message for YOU specifically… the public key is the customization of an already used algorithm (RSA, ECC)

The cipher is the algorithm, and the** key** is the specific variable used to customize it. (Should be random and long enough). We can know how a combination lock works, but we will keep the numbers secret. We can understand the concept of shifting letters, but not tell how many to shift by. It allows the public to determine how robust the algorithm is and think hmmm maybe I won’t use this

27
Q

What are digital signatures used for?

A

To authenticate the sender and ensure data integrity

28
Q

What is a public-key certificate?

A

Verifies ownership of public key, issued by a trusted Certificate Authority (CA).

29
Q

What is a digital envelope?

A

A hybrid method combining symmetric encryption for data and public-key encryption for the symmetric key

30
Q

Why are random numbers important in cryptography?

A

Used for generating keys, session keys, and preventing replay attacks.

31
Q

Replay Attack

A

Attacker intercepts a legitimate message and resends it to trick the recipient into believing it’s valid.

32
Q

What is the difference between true random and pseudo-random numbers?

A

True Random (TRNG): Produce randomness by measuring unpredictable natural processes (nondeterministic source)
Pseudo-random: Deterministic but passes statistical randomness tests

EX: radiation, gas discharge, leaky capacitors

TRNG increasingly provided with modern processors

33
Q

Where are random numbers used?

A
  1. generationg of keys (public-key algorithms)
  2. Stream key (symmetric stream cipher)
  3. Symmetric key (temporary session key or for digital envelope)
  4. Handshaking to prevent replay attacks
34
Q

2 criteria for randomness

A
  1. Uniform distribution (frequency occurence of each number almost the same)
  2. Independence (can’t infer one value from others)

Unpredictability

35
Q

What Happens When You Visit an HTTPS Website:

A

You request https://example.com.
The website sends you its digital certificate (which contains its public key and the CA’s signature).
Your browser:
Checks the CA’s digital signature (by using the CA’s public key, which your browser already trusts).
If the signature is valid, the website’s public key is trusted.
Now, your browser generates a random session key, encrypts it with the website’s public key, and sends it to the site.
Only the website (with its private key) can decrypt the session key, enabling secure communication.