Basic Cryptography Flashcards
What is cryptography?
refers to the art and science of concealing meaning
What is a cryptosystem?
a system where a sender/transmitter transforms all unconcealed data (plaintext) into concealed data called ciphertext using an encryption algorithm
The receiver then transforms the received ciphertext back to the plaintext using a decryption algorithm
What is a cipher?
encryption and decryption algorithms
What are the two broad types of cryptosystems?
Private key and public key
What is the encrypt function
EM = E(K, M)
What is the decrypt algorithm
M = D(K, EM)
What is “Simple Division by Key”
The secret key is a number, each letter is assigned a numbered value and then encoded by dividing that number by the key. The letter is then the quotient and the remainder (2 digits)
What are the two types of historical cryptosystems?
Substitution ciphers (value of plaintext is replaced), and Transposition ciphers (position of plaintext alphabet are changed without changing their values)
What are the two types of substitution ciphers?
Monoalphabetic and Polyalphabetic
What is the beale cipher
a polyalphabetic substitution cipher.
The key is a string of letters, the plaintext is written under the key, each plaintext character is shifted by value
What is the vigenere cipher
The key is represented by a string of letters. Each key letter represents a certain shift of the plaintext character.
Find the PT letter row and the Key letter column to find the CT character
What is the digraphic substitution cipher
Create a 5x5 table. Begin to fill the table with the key, then the rest of the alphabet excluding the letters that exist in the key.
Divide the PT into groups of two characters.
Find a rectangle that contains each group, switch the corner characters to get the CT.
If there are only two characters in the same row, wrap the row left to right. If there are only two characters in the same column wrap to the next character in the column
What is a rail fence cipher?
write the plaintext in 2 rows. Then write the cipher text out by writing the first row and then the second
What is the matrix cipher?
Write the plaintext in a matrix of n columns rowwise.
Create a key and use it to determine the order and write the CT by taking the columns in the order dictated by the key.
What was the Enigma Machine?
A polyalphabetic substitution cipher. It used a machine with mechanical rotors that changed the electronic circuitry for ciphering.
What is a one-time pad?
A one time pad consists of a set of non-repetitive keys where each key consists of a truly random set of letters. The keys are written on separate sheets of paper, and the sheets are glued to a pad.
Each time a message is transmitted a new key is selected from the top of the pad. The receiver has an identical set of keys, once the key has been used, both sender and received discard that key.
In current systems, this concept is used in pseudo-random number generators for stream ciphers.
Why aren’t traditional private key cryptosystems robust?
- The key can be found after reverse engineering using known plaintext attacks
- The fact that certain letters of the English alphabet are more frequent than others allows for educated guesses to be made
- Traditional systems are not robust against cryptanalysis
What can be done to improve traditional private key cryptosystems?
- Better ciphers must prevent the attacker from reverse engineering the key
- Make the encryption algorithm so complicated that none of the plaintext remains in the corresponding ciphertext
- Two categories of such ciphers are Block ciphers and Stream ciphers
Describe the structure of a Block Cipher diagram
Plaintext (in blocks of size m bits) undergoes a block cipher algorithm with a key of substitution, permutation, and looping to output Ciphertext (in blockes of m-bits size)`
What is DES?
- DES stands for data encryption standard
- has an initial permutation, 16 rounds of processing, a final permutation on each 64-bit input block
Describe the overall DES structure diagram
- a 64-bit input block undergoes an initial permutation.
- a 56-bit secret key gets broken into 16 - 48-bit keys
- The input block undergoes 16 rounds of processing using each of the 16 generated keys
- A final permutation is performed giving the 64-bit ciphertext output block.
How does DES achieve security?
It achieves security by confusion and diffusion
What is the drawback of ECB (electronic code book)
Identical plaintext blocks give identical ciphertext blocks. This can help in reverse engineering the key.
What are the drawbacks of Cipher Block Chaining (CBC)?
- If there is an error in one block, it will propagate to all subsequent blockes
- Sequential processing is slow
Why does 3-DES use EDE and not EEE (where E is encrypt and D is decrypt)
EEE would cancel out one E which would reduce brute force attack time . With EDE there is no cancellation.
What is a stream cipher?
A stream cipher generates a continuous bit stream from a given plaintext bit stream by encrypting the plaintext on a bit by bit basis
How do stream ciphers generate a key stream from a secret keys?
All stream ciphers use pseudorandom sequence generators (PSG) to generate a key stream from a secret key
- A pseudorandom sequence is initialized by the secret key
- Not mathematically random but passes most tests for randomness
- plaintext is XORed with the sequence bit by bit to generate the ciphertext
- The receiver uses the same secret key as a seed to generate the pseudorandom sequence and XORs it with the ciphertext stream bit by bit to produce the plaintext
What are the advantages of a stream cipher?
- High throughput
- light weight
- bit errors are not propagated
What are the disadvantages of a stream cipher?
Sender and receiver synchronization is required
Strength of the cipher relies on the strength of the PSG