Cryptography - Symmetric, Asymmetric, Basics Flashcards
Define
Symmetric Cryptography
Encryption key = decryption key
Algorithm for Symmetric Cryptography
- Generate key (KeyGen() => K )
- Encrypt message (E(K, M) = EK(M) = C )
- Decrypt message (D(C, K) = DK(C) = M )
What is the attacker’s goal in symmetric cryptography?
Find out any information on the message(s) or the key
What is the goal of the defender in symmetric cryptography?
The attacker shouldn’t be able to distinguish which 2 messages were encrypted in cipher
List the types of symmetric cryptography attacks
- Ciphertext
- Known plaintext
- Chosen plaintext
- Chosen ciphertext
Describe
Ciphertext Attack
Symmetric Cryptography
Eve observes every instance of Cipher and has partial information Message (i.e. knows what language was used)
Describe
Known Plaintext Attack
Symmetric Cryptography
Eve knows part of Message and/or entirty of numerous Messages
Describe
Chosen Plaintext Attack
Symmetric Cryptography
Eve picks a Message for Alice to encrypt
Describe
Chosen Ciphertext Attack
Symmetric Cryptography
Eve picks a ciphertext for Bob to decrypt
Describe
Secure Cryptic System
A costly system to break into
Why are the costs high to break into a Symmetric Crypto system?
- Expensive - exhaustion of resources and efforts
- Useful lifetime of information may expire
Probability of an Attacker winning
Symmetric Cryptography
Pr[Attacker wins] <= 50% or 1/2 + e
Describe
Pseudorandom Number Generators
Symmetric Cryptography
A random-looking value that is actually determinastically created for inital vector
Describe
Stream ciphers
Symmetric Cryptography
Encrypting a plaintext with a pseudrandom digit 1 bit/byte at a time
Pros of Symmetric Cryptography
Strong confidentiality
Cons of Symmetric Cryptography
- Weak authenticity
- Weak integrity
- Difficult to manage and distribute the secret keys
Describe
One-Time Pad
When a random key is chosen and used once for each message
How long is a one-time pad?
As long as the message itself (revealing the length of the message)
What type of secure are one-time pads?
IND-CPA and IND-KPA
What are the limits to one-time pads?
- Must be truly random and independent
- Requires secure distribution of secret keys
- A large message would make a difficult one-time pad to manage
Define
IND-KPA
When attacker can’t distinguish between 2 encryptions of the same key while knowing 2 plaintexts
Define
IND-CPA
When the attacker can’t distinguish between encryptions of different plaintext under the same key while knowing ciphertexts
Which is stronger between IND-CPA and IND-KPA?
IND-CPA
What does IND-CPA imply?
That IND-KPA also holds true
Describe
Caesar Cipher
Rotation of letters by the kth position
How can you defeat a Caesar Cipher?
- Brute force
- Frequency analysis
- Known plaintext attacks
- Chosen plaintext attacks
Upgrade
Caesar Cipher
Rotate the first character by K1 position, the second character by K2 position, … the nth character by Kn position
Describe
Block Cipher
A determinalistic algorithm on a fixed block/length of bits
A Block Cipher is not what type of secure?
IND-CPA
Using a Block Cipher: short message
Includes padding
Using a Block Cipher: long message
Repeat block cipher (Block Cipher Mode) and hide the same block encrypted twice along with inital vector (IV) for randomness
Block Cipher Modes
- Electronic Code Block (ECB)
- Cipher Block Chaining (CBC)
- Counter (CTR)
Describe
Electronic Code Block (ECB) Mode
The message is split into n-bit blocks where each is independently encrypted/decrypted. All blocks will then be concatenated (output)
Describe
Cipher Block Chaining (CBC) Mode
Uses a one time initial vector and includes the output of the previous block as input for the current block
What type of secure is the CBC Block Chaining Mode?
IND-CPA
Describe
Counter (CTR) Mode
Selects a random initial vector and increments it for each block
What type of secure is the CTR Block Chaining Mode?
IND-CPA
Define
Key
A randomly chosen value
Define
Cryptoanalysis
Analysis of the algorithm/implementation to interfere with cryptography
List all cryptographical algorithms
- Symmetric
- Asymmetric
- One-Way Function
- One-Way Hash Function
Define
One-Way Function
A computation that is difficult to inverse
Define
One-Way Hash Function
Given any string input, a fixed binary sequence random output would be returned
Two ways to preserve integrity and authentication in cryptography
Strong hash functions and message authentication code (MAC)
Why are strong hash functions not sufficient for cryptography?
Strong hash function values can be guessed
Properties of a strong hash function
- One-way: given y, it’s difficult to find x
- Collision resistance: difficult to find x, x’
- Second pre-image resistance: given x, it’s difficult to find x’
Describe
Message Authentication Code (MAC)
A tag that verifies authentication and requires a shared secret key
Define
Asymmetric Cryptography
Encrypting a message with recevier’s public key and decrypting the message with receiver’s private key
Requirements for asymmetric cryptography
- Key Generation: public key can’t compute the secret key (or vice versa)
- Trapdoor permutation: 1-way perm without special instructions
Describe
RSA Key Generation
Asymmetric Cryptography
Uses Euler’s Toitent to create the keys
Describe
Euler’s Totient
Finding two very large prime numbers
Pros of Asymmetric Cryptography
- Secure key distribution
- Confidentiality
Cons of Asymmetric Cryptography
- Weak integrity
- No authentication
- Repudiation (can be seen as falsified)
Define
Diffie-Hellman Key (DHK) Exchange
The same secret key is shared
Limitations of Diffie-Hellman Key (DHK) Exchange
- No authenticity
- Subject to MITM attacks (doesn’t verify who’s involved)
Define
Ephemeral Diffie-Hellman Key (EDHK) Exchange
Temporary DH key (shared secret key) generated for every connection
Limitations of the Ephemeral Diffie-Hellman Key (EDHK) Exchange
Higher overhead costs
What does the Ephemeral Diffie-Hellman Key (EDHK) Exchange provide?
Forward secrecy
Define
Forward Secrecy
When future compromises of passwords/secret keys from previous sessions cannot be used to retrieve encrypted sessions/communications from the past.
Define
RSA Signature
A verifiable message that anyone can prove that a private key was used (digital signature algorithm)
Upgrade
Asymmetric Cryptography Approach
A encrypts message with A’s secret key => A encrypts message again with B’s public key => B decrypts ciphertext with A’s public key
Limitation to the Upgraded Asymmetric Cryptography Approach
MITM attacks can still occur
What does the Upgraded Asymmetric Cryptography Approach resolve?
CIA and repudiation concerns
Describe
Public Key Certificates
Binds an identity with their public key and prevents interception by endorsing/guaranteeing legitimacy from the Certificate Authority (3rd party)
How does the Certificate Authority publish their own certificate?
Self-sign or have it signed by another Certificate Authority (company)
Why do Certificate Authorities have to publish their own certificates?
To avoid interception