SE4472 FINAL Flashcards
How large is a block in DES?
8 bytes
How large is a block in AES?
16 bytes (128 bits)
What is perfect secrecy?
No way to brute force (one-time pad)
What are the three goals of security?
confidentiality (encryption, public key exchange)
integrity (MACs, hashes)
authenticity (digital signatures, certificates, public key infrastructure)
What are the requirements for an ideal block cipher?
- Encryption should be reversible
- returns original message
- bijection (1:1 mapping)
- permutation (strings map 1:1 w/ itself) - Easy with the key, hard without
- Efficient to compute
What is the difference between a PRP and PRF?
PRF (pseudo random function) does not require 1:1 mapping
What is a feistel network?
Method of turning a PRF into a PRP
- twisted ladder, at least 4 rounds
- decrypt by running backwards
What is the security level of CBC?
If the IV is known: IND-EAV secure
If the IV is random: IND-CPA secure
What is the security level of AES-GCM?
IND-CCA2
What is the security level of ECB?
None (Not IND-EAV secure)
What is the security level of CTR?
If the IV is known: IND-EAV secure
If the IV is random: IND-CPA secure
What is the probability of a successful pre-image resistance attack?
2^(l-1)
** -1 since we already know 1 hash which is the one we are trying to guess with a guess message
What is the probability of a successful second pre-image resistance attack?
2^(l)
**asked essex about this
What is the probability of a successful collision attack?
2^(l/2)
**birthday paradox
How many bits is an MD5 hash?
128
What is computational secrecy?
Not perfect, but only vulnerable to brute force
Public-key exchange achieves which security goal?
confidentialy
MAC codes achieve which security goal?
Ingetrity
Digital signatures achieve which security goal?
Authenticity
What security level does a caesar cipher offer?
None
Deterministic ciphers can offer at most what level of security?
IND-EAV
In a Feistel network, how many rounds is required to turn a strong PRF into a PRP?
4
What block size does DES use?
64 bits
what is security rule #1?
Don’t roll (create) your own crypto
What is security rule #2?
Kerckhoff’s Principal:
- A crypto system should be secure even if the algorithm is public
- Secrecy of the message should depend on the secrecy of the KEY, not security through obscurity of the algorithm
What is second pre-image resistance?
Given m1 and h, it is hard to find another message m2 that produces the same hash
Define plaintext
A message to be encrypted
Define Ciphertext
the encrypted message
Define Key
secret that is used to transform plaintext into ciphertext
How many queries would be required for a padding oracle attack (worst case)?
255 queries/byte * 16 bytes = ~4000 queries
Goals of cryptosystem designers
- Key space exponential in key length
- Infeasible to brute force ( > 2^100)
- Brute force = worst case
What is pre-image resistance?
given hash h, it is hard to find a message that hashes to h
TLS uses what approach to authenticated encryption?
MAC-then-encrypt
What is second pre-image resistance?
Given m1 and h, it is hard to find another message m2 that produces the same hash
What are the 3 properties of a one-time pad?
- Pad chosen independent to text, and at random
- Pad is exactly as long as the message
- Pad is only ever used once
Properties of computational (practical) security:
- Short length key
- Crackable with enough computing power
- Too many keys to brute force
what is message authentication?
know who the message came from
Reasons why one-time pad is not feasible:
- Generating, transporting, storing too costly
- size of key is long
- Human error such as pad re-usal
Properties of computational (practical) security:
- Short length key
- Crackable with enough computing power
- Too many keys to brute force
T/F: A linear modification in the ciphertext is preserved
in the plaintext in CTR mode
T
T/F: Flipping a bit of ciphertext in CBC mode totally corrupts every plaintext block
F: Only corrups current plaintext block, but flips the bit in next block
How would you pad this message using AES and PKCS#7:
68 65 6c 6c 6f 20 77 6f 72 06
68 65 6c 6c 6f 20 77 6f 72 06 06 06 06 06 06 06
How many queries would be required for a padding oracle attack (worst case)?
255 queries/byte * 16 bytes = ~4000 queries
How do you prevent a padding oracle attack?
Don’t let your decryption function return a
plaintext unless the ciphertext was valid (use MAC)
GCM uses what approach to authenticated encryption?
Encrypt-then-MAC
TLS uses what approach to authenticated encryption?
MAC-then-encrypt
T/F: public keys are used to undo something (decrypt)
F: private keys are used for undoing.
Public keys are used for doing (encrypting)
Why are the Caesar and Vigenere ciphers not secure?
They both leak letter frequency
Why is Enigma not secure?
Leaks information about what the plain text is not
What does CCA stand for
Chosen Ciphertext Attack
Definition of A’s advantage in winning the game
Adv(A) = | P(b’ = b) - 0.5 |
Does A have an advantage if winning more than 50% of time?
Yes
Does A have an advantage if winning LESS than 50% of time?
Yes, pick opposite guess of what A thinks
Does A have an advantage if they win exactly 50% of time?
No
How is negligibility defined?
In terms of how the keyspace grows relative to the adversary advantage
What is a negligible function?
e() is a negligible function if it grows more slowly than the inverse of a polynomial function: e(k) < | 1 / poly(k) |
what does PPT stand for
Probabilistic Polynomial Time
-Realistic to computational resources
What happens when you encrypt the same message twice using the same key, and the encryption is non-deterministic?
you get a different ciphertext every time.
How can you prove enigma is not CCA2 secure
Use CPA or CCA attacks (or anything else of a lower security level than CCA2 such as EAV) to prove it is not CCA2
What does CPA stand for?
Chosen Plaintext Attack
What does CCA stand for
Chosen Ciphertext Attack
What is the difference between CCA1 and CCA2
CCA1: Adversary can only make decryption queries BEFORE the challenge text is sent
CCA2: Adversary can make decryption queries both before and after challenge, but not the challenge itself
List the permitted queries of IND-EAV Security
None
List the permitted queries of IND-CPA Security
Pre challenge: encryption only
Post challenge: encryption only
List the permitted queries of IND-CCA1 Security
Pre challenge: encryption / decryption
Post challenge: encryption only
List the permitted queries of IND-CCA2 Security
Pre challenge: encryption / decryption
Post challenge: encryption / decryption
if a ciphertext is IND-CCA1 is it also CPA secure?
Yes, each security level inherits the capabilities of anyone before it.
if a cipher text is IND-CPA is it also IND-CCA1?
Insufficient information
Prove all deterministic ciphers cannot be IND-CPA secure
Query Phase:
A sends m0 / m1 and gets c0 / c1
Challenge Phase: A sends m0 and m1 as challenges B sends cb if cb = c0; m0 is correct ... if cb = c1; m1 is correct A wins 100% of time
What is the triple of functions for block cipher?
how many plaintexts are in an ideal block cypher?
2^b
how many possible permutations of plaintexts are in an ideal block cypher?
2^b!
How do block cyphers work?
- Take b bits of message plaintext
- Encrypt them to b bits of cipher text
-encryption done in blocks (vs. classical single letter)
DES - 8 bytes
AES - 16 bytes
What is the purpose of a PRP in terms of an electronic code book
Allows you to efficiently compute the code book with exponentially many entries that would normally be computationally infeasible.
In CBC mode does the XOR come before or after the Encryption?
c-B-c mode B= Before
Why do we need Hash functions?
Whenever it would be beneficial to create short fixed-length strings as a fingerprint to digest arbitrary length string
In CTR mode, does the XOR come before or after the Encryption?
After
Main difference between CTR and CBC?
CTR can be run in parallel while CBC must be run in series since the previous block creates the next block
What does AES stand for?
Advanced Encryption Standard
Does AES use a feistel network?
No, it uses Galois field operations
What is the round function of AES
a PRP using Galois field arithmetic
Why Galois fields?
Addition is just bit-wise XOR, Multiplication is simple bit wise operations, so GF operations are fast in hardware and easy to explain
How do block cyphers work?
- Take b bits of message plaintext
- Encrypt them to b bits of cipher text
-encryption done in blocks (vs. classical single letter)
DES - 8 bytes
AES - 16 bytes
What key sizes does AES support?
128bit, 196 bit, or 256 bit keys
In AES can the key length differ from the block size?
Yes
Using AES, under PKCS #7, if I had an 8 byte message, how many bytes of padding do I need, and what HEX value of each byte do I need
8 bytes of PKCS7 padding, and they are all 08:
XX XX XX XX XX XX XX XX 08 08 08 08 08 08 08 08
What i a random oracle?
- Every arbitrary input, random oracle outputs a random fixed-length string
- each unique query is independent of others
- if you repeat a query to the oracle, it gives the same answer
What type of function is a hash function?
Pseudo-random function
What are the 3 properties of hash functions?
- Pre-image resistance
- Second pre image resistance
- Collision resistance
Explain Pre-image resistance
Given a hash, it should be hard to find a message producing the hash
Explain Second pre-image resistance
Given a message, it should be hard to find another message that produces the same hash
What is the goal of message authentication?
Make it infeasible for an attacker to generate a valid ciphertext
What is a MAC
A function that accepts an arbitrary length plaintext and
a key and produces a fixed-length value that serves as an authenticator code/tag
like a hash, but must be infeasible to forge code/tag without key
Do MACs prevent padding oracle attacks?
Yes
How does a MAC prevent padding oracle attacks?
Receiver accepts or rejects message based on MAC not based on the message.
Receiver doesn’t look at message unless MAC is valid
Under PKCS #7, if I had an 8 byte message, how many bytes of padding do I need, and what HEX value of each byte do I need
8 bytes of PKCS7 padding, and they are all 08
Using AES, under PKCS #7, if I had an 16 byte message, how many bytes of padding do I need, and what HEX value of each byte do I need
16 bytes of padding in a new block, and 16 in hex is 10 so it would be 16 bytes of 10:
10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
What does a padding oracle tell you?
Cipher text —-> Padding oracle —-> tells you either the plaintext has valid or invalid padding