Unit 2: Symmetric Cryptography Flashcards
Eavesdropping
a passive attack, just listening
Manipulation/Corruption
an attacker is actively involved; stops message, changes/replaces the message, so that when the recipient gets it, it’s not the right message
Interception
attacker stops the message from getting to the recipient; crypt doesn’t prevent the messages from stopping the attacker from doing it, but it will stop them from reading the message
Notation
EK(M) = C
Apply encryption on plaintext M using key K to obtain ciphertext C.
DK(C) = M
Apply decryption on ciphertext C using key K to obtain plaintext M.
Is it better to keep keys private and publish the function, or keep function private and publish the keys?
Better to keep keys secret and publish the function of encryption
- Different key for communicating with different recipients
- If you keep the function secret, and trade keys publicly, then the adversary can compromise all the messages
Keep adversary’s life difficult by keeping both function and the keys from them–ideal situation is to keep both secret if possible
Kerkhoff’s Principles
(1) indecipherable (2) can be stolen without causing trouble (3) easy to communicate/remember (4) compatible with telegraph (now digital) system (5) portable/usable (6) easy to use
* **
(1) System must be practically, if not theoretically, indecipherable (code takes 1,000 years to break, etc.)
(2) System must not require secrecy and can be stolen by the enemy without causing trouble (as long as you have strong keys, that should be sufficient)
(3) Key must be easy to communicate and remember (without the help of written notes) and must be changeable or modifiable at the will of the correspondents (keys must be changed regularly)
(4) System must be compatible with the telegraph system (applicable at the time Kerckhoff wrote this) - now, we would say it must be compatible with digital data
(5) Apparatus should be portable and its use must not require the aid of several people (useability issue)
(6) The system must be easy to use, requiring neither mental strain not the knowledge of long series of rules to observe (instructions are clearly understood and can be applied with a high degree of fidelity for the individuals involved in encrypting the messages)
Brute force
if you cannot analyze the plaintext, the only approach is to apply the decrypt function and try every possible key until something works; also intimidation, torture, etc.
- start with 0 and then keep trying numbers after that
Key space
# possible keys for an encryption function - When a cipher requires a key length of n bits, the key space (# possible keys for an encryption function) is 2^n
How is a cipher secure?
- Computational security: resistance to a brute force attack (keyspace is so large that you can’t get through the keyspace is a reasonable amount of time)
- Semantic security: no amount of analysis can reveal the key; you must have both plaintext and cipher text to find the key
- Perfect security: must have both computational security and semantic security; must also be theoretically impossible to break
Indistinguishability in a Chosen-Plaintext-Attack (IND-CPA)
Usually described as a game; you as the attacker choose 2 message, feed it into box (you know the encrypt function, but don’t know key or what message will be chosen)
If you can beat the odds of 50/50, then you have an advantage - something is wrong with the encryption function, which cause info to leak, which allows adversary to determine which of the two plaintext messages was encrypted
Indistinguishability in a Ciphertext-Attack (IND-CCA)
if you don’t know key, but know function; decrypt cipher texts and black box provides corresponding plaintext
If you can determine the key if you have plaintext M, then the function is not secure
Entropy
describes a measure of uncertainty/randomness/disorder; patterns
- Order and structure (low entropy)
- Uncertainty and randomness (high entropy)
Sources of randomness in an OS
time between keystrokes, fluctuations in clock frequency, static from sound card, mouse movements, hardware interruption…
Pseudorandom Number Generator (PRNG)
- the randomness of the sequence is dependent upon the randomness of the initial seed only–same seed, same sequence
- Function to produce a random stream of data not deterministic that always gives same output with same input; could be used to select keys when you don’t have a good source of randomness and you need to create a key (give it a seed to start with, feds it through function to get a PRN as output) - looks like it’s random but it’s not, but is good enough in most cases
- A short cycle is bad; so is “clumping” (low entropy)
- Encryption can’t randomly map to ciphertext because that could be reversed and figured out
Block cipher vs. stream cipher
- Block cipher: operates on a fixed input (ex: i character, [8 bits]) at a time
- Stream cipher: can operate on any sized, non-fixed input (can do 3 bytes, 3 bits…)- used when encrypting network data that is moving quickly