Encryption Flashcards
What is encryption, and what are the plaintext and ciphertext?
Encryption scrambles data into a form that can’t be understood without a decryption key. Plaintext is the original data, and ciphertext is the encrypted form.
What is decryption?
Decryption is the process of converting ciphertext back into plaintext using the appropriate key.
How does the Caesar cipher work?
It shifts each letter in the plaintext by a fixed number of positions in the alphabet, e.g., A becomes B with a shift of 1.
How can the Caesar cipher be cracked?
- Brute force through all 25 possible shifts.
- Use frequency analysis to identify the most common letters.
Which letter is the most common in English text?
The letter ‘E’ is the most common.
Why is the Vernam cipher considered perfectly secure?
The key is truly random.
The key is as long as the message.
The key is used only once and then destroyed.
How does the Vernam cipher encrypt text?
By XORing each bit of the plaintext with the corresponding bit of a one-time pad.
What conditions must be met for perfect security in the Vernam cipher?
- The key must be truly random.
- The key must be at least as long as the message.
- The key must be used only once.
Encrypt ‘CAT’ using a one-time pad ‘GTS’. Show ASCII XOR process.
Plaintext (‘CAT’): 1000011, 1000001, 1010100
Key (‘GTS’): 1000111, 1010100, 1010011
XOR Result: 00000100, 00010101, 00001111.
What is Run Length Encoding (RLE)?
A lossless compression method that encodes repeated data as a single value and a count, e.g., 5G for GGGGG.
Define the terms cipher and key.
Cipher: The algorithm used for encryption and decryption.
Key: The secret information used in the encryption/decryption process.
What is computational security compared to perfect security?
Computational security means encryption cannot be cracked with current technology in a reasonable timeframe.
Perfect security means it is mathematically impossible to crack the cipher.
Name methods used to crack ciphers.
- Frequency analysis.
- Dictionary attacks.
- Brute force.
Why is RLE considered lossless compression?
Because no data is lost during the process, and the original data can be perfectly restored.
How could you implement a Caesar cipher in Python?
By using loops or functions to shift the ASCII values of characters in the plaintext.