Encryption2 Flashcards
Approaches to breaking a cipher
1) Brute attack
2) Linguistic analysis
Linguistic analysis
To attempt to exploit any linguistic patterns inherited from the plaintext (for textual contexts only)
To combat brute force attack, we need:
A very large key space
To combat linguistic analysis benefits, we need:
A weak association between the linguistic patterns in the plaintext and ciphertext
How to decouple from the linguistic patterns of the plaintext?
One way to do so is to encrypt with a cipher that uses a succession of different keys, which can be achieved using the Vigenere cipher
Vigenere cipher
Uses a key known as a**
running key**, which is generated by a keyword
Weakness of a Vigenere cipher
Where similar letters appear at distances corresponding to the keyword length, their ciphertext letters will match each other.
Given a large enough sample of ciphertext, the probability of such an issue to appear increases.
* A cryptanalyst can hence determine the length of the running key ‘n’
* Every nth symbol can then be treated and analyzed as one strand
* The cipher can then be easily solved
An unbreakable cipher
As a solution to the Vigenere cipher, the unbreakable cipher uses a key that is identical to the plaintext’s length, and only use it once, and such a method is known as one-time pad encryption.
A one-time pad encryption:
- A random key – the pad – is generated that is at least as long as the plaintext message
* Two copies of the pad are required
* one is used by the sender to encrypt the message.
* one is used by the recipient to decrypt the message. - Once it has been used, both copies must be destroyed
The random nature of the pad (key) means that:
- The ciphertext has no linguistic association with the original plaintext
- The ciphertext cannot be broken by analysis or brute force.
Note: all previous ciphers are text-based and later used in wireless telegraph, but they’re unpractical for today’s use
A block cipher
Breaks the plaintext into equal-sized blocks,
usually of 64 or 128 bits, and encrypts each block separately to produce a ciphertext output exactly equal in length to the input.
There are two basic approaches to block encryption
1) to encrypt each block independently of any other
2) to encrypt each block so that its output ciphertext is dependent on the output of the previous block
Electronic Codebook (ECB)
An independent encryption approach. It will:
- use the same key for each block
- encryption of each block is completely independent from other blocks
Drawbacks of ECB:
-Two similar blocks of plaintexts will result in similar blocks of ciphertext
-Since the position of the ciphertext blocks remains fixed relative to the plaintext blocks, it introduces vulnerability
-ECB is not practical when it comes to repeated strings of 1s and 0s, such as in a picture data
Cipher-block chaining (CBC)
A dependent encryption approach. The process:
-an XOR process is used to combine the ciphertext output from one block with the plaintext input of the following block.
-Every ciphertext block is dependent on the ciphertext output from the preceding block as well as its own plaintext input
-An encryption of identical input blocks will produce different results.
-CBC mode requires an additional extra input, known as an Initialization vector (IV), to the first block.
Initialization Vector (IV)
a pseudo-random binary sequence that is used in the XOR process for the first block only
Drawbacks of CBC:
- A single encryption error in one block is cascaded through to the following blocks.
- The decryption relies on knowledge of the previous block. Any error or loss of data in the previous block prevents that block
and all following blocks from being decrypted
Stream ciphers
Unlike block ciphers, stream ciphers operate on small segments of data, usually at the bit level.
Whereas block ciphers have to wait to receive a whole block before starting the encrypting process, stream ciphers can ‘encrypt on the fly’ one bit (sometimes byte) at a time.
Stream ciphers use a short key that acts as a ‘seed’ to generate a much longer, apparently random, key stream.
The key stream is then combined (usually by an XOR process) with the plaintext to produce ciphertext.
Stream cipher decryption
Decryption is also carried out ‘on the fly’ and using the same key stream as the encryption process.
* The sender and the receiver must be synchronized to ensure that the same key is used on each individual bit (or byte) of data.
When are stream ciphers often used?
1) Where the input stream length is unpredictable (such as in telecommunications)
2) Where the input buffering is limited
Buffering
Temporarily storing bits
Symmetric key system
Encryption and decryption are performed using a single key or, two keys that are so closely related to each other mathematically.
What is the issue or problem with single key systems?
The inherent problem with single key systems is secure key distributions.
To protect a message, it could be encrypted using a private symmetric key and then sent over an insecure channel, but to decrypt the message the recipient must have
a copy of the private key