ChatGPT Chapter 2 - Cryptography Flashcards
What is cryptography used for?
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
What are the two basic operations in cryptography?
- Encryption: Convert plaintext into ciphertext
- Decryption: Convert ciphertext back to plaintext
What is cipher?
Algorithm used to encrypt and decrypt data.
What is a key in cryptography?
A piece of information that works with the cipher to encrypt and decrypt messages
What is the Caesar Cipher?
Substitution cipher where each letter is shifted by a fixed number of positions
Ex: A becomes D (shift of 3)
How can the Caesar Cipher be attacked?
- Brute Force: Trying all possible keys
- Cryptoanalysis: Using letter frequency analysis
What is symmetric key encryption?
Encryption where the same key is used for both encrypting and decrypting data
What is the key distribution problem?
If both sender and reciever use the same key then how do you share the key without someone intercepting it?
What are the requirements for secure symmetric encryption?
- A strong encryption algorithm
- Secure key exchange and storage
What are common attacks on symmetric encryption?
Brute Force and Cryptoanalysis (exploit algorithm weaknesses)
Examples of symmetric encryption algorithms
- DES: Weak and outdated (56-bit key)
- 3DES: Encrypt 3 times with DES (stronger but slower)
- AES: Fast and secure (128, 192 or 256 bit keys)
What is the difference between block and stream ciphers?
Block: Encrypt data in fixed-size blocks (AES)
Stream: Encrypt byte by byte, faster and lightweight
What is a Message Authentication Code (MAC)?
Short piece of data that verifies the authenticity (who) and integrity (unchanged) of a message
Uses a key and a MAC algorithm
Don’t confuse with MAC address used to locate device on network
HMAC
Hash-based Message Authentication Code, verify that a message hasn’t been tampered with, if the hash value of the received message matches the expected value, it is intact
Example of MAC use
When you make a payment online, the bank can use HMAC to verify that the payment details weren’t altered during transmission.