Cryptography Flashcards
When do we have secure communication?
When there is no tampering (integrity) or eavesdropping (confidentiality)
When do we have secure data storage?
No information leakage (confidentiality) or tampering (integrity)
What are the 2 steps of secure communications?
- Establish a secret key (face-to-face, trusted courier, handshake algorithms)
- Transmit data using the shared secret key
Name 6 ciphers that provides confidentiality
Polybios
shift cipher
Vigenére method
One time pad
Stream cipher
Block cipher
What ciphers provide integrity?
ECB
HMAC
Describe the Polybios cipher
Partition the alphabet in a grid.
Each plaintext letter is represented by 2 number (row, col)
What is the shift cipher?
Each letter is a number: A-0, E-4
K: Encryption key
Enc:
C = (M + K) mod 26
Dec:
M = (C - K) mod 26
Why is the shift cipher insecure?
Only 26 keys
Monoalphabetic - one plaintext alphabet to ciphertext alphabet mapping.
Plaintext is easily recognizable during brute force
Describe the Vigenére cipher
Key is a string
Shifts each plaintext character with the amount dictated by the character of the key
Compare Vigenére and shift
Vigenére: Larger key space
Key length n: Keyspace = 26^n
Brute force is expensive
When is Vigenére insecure?
Given a long ciphertext.
If key length is n, then every n character is encrypted using the same character.
This can be used to break the cipher
How can the period of the Vigenére cipher be broken?
Make a guess for n, and divide the ciphertext into sub-block containing letters encrypted using the same key.
Run a frequency analysis on the sub-blocks. When the period value is correct, the requency distribution should mirror the frequency distribution og the english language.
For each sub-block, calculate the similarities of the frequencies in the sub-blocks and in the english language
Calculate the avarage value of the similarities of all sub-blocks.
Of the guessed period, choose the period with the highest avarage similarity.
How can Vigenére be broken, when we know the period?
Extract the sub-blocks of the ciphertext, using the period n.
Run a frequency analysis on each block. Compare it to the english language to figure out what ciphertext letters represent which english letter. Use this to find the ciphertext representation of the most common letter in the english alphabet (such as E).
When this is done, we know the Key for the block.
Do this for each block to put together the whole key
What is the one time pad?
Enc:
C = P XOR Key
Dec:
P = C XOR Key
Perfect security
What is perfect secrecy?
Observing the ciphertext should not change the attacker’s knowledge about the distribution of the plaintext.
What are some limitations of the one time pad?
Key must be atleast as long as the plaintext
New key for each message
How can the OTP be misused?
Use the same key to encrypt 2 or more messages. The cipher is then no longer perfectly secure.
How can OTP be broken when two ciphertext are encrypted using the same key?
C1 = m1 XOR k
C2 = m2 XOR k
C1 XOR C2
= m1 XOR k XOR m2 XOR k
= m1 XOR m2 XOR (k XOR k)
= m1 XOR m2
m1 XOR m2 reveals information about m1 and m2
Info:
- All letters in binary begins with 01
- XOR-ing 2 letters will there for being with 00
- Space begins with 00
- XOR letter with space gives 01
Does OTP provide integrity?
No
What is quantum key distribution
utilizes the unique properties of quantum mechanical systems to generate and distribute cryptographic keying material using special purpose technology
What issue does stream ciphers address?
OTP key is as long as the message