Block encryption means that a whole block of data is processed, for instance block of 4 bits. If we have only 2 bits of plaintext, we need to add the so called pad bits (agreed before communication or using such way that would not confuse our partner) to fill in the whole block. Stream cipher encrypts a bit/byte at a time.
Ideal block cipher maps all input blocks of bits of plain text to cipher text blocks. The key is then this mapping but we can agree to omit the plaintext blocks. Nevertheless, the key length would be n . 2n (we have 2n possible variations of blocks and each block is of length n).
Product cipher is a combination of substitution ciphers and transposition ciphers. It is quite common nowadays to combine these two approaches, see DES, AES, 3DES, etc.
Permutation cipher is another member of transposition ciphers family. Encryption is realized through the following steps:
- choose the length of the key N; it specifies number of columns we will use for encryption
- create a permutation of numbers 1 to N; for instance for N = 4, it could be [2,4,3,1]
- write the plain text to columns (from left to right, from top to bottom)
- shuffle it based on the key and write to rows; in our case key [2,4,3,1] says column one will be second part of the cipher text, column two will be fourth, etc.
In last few articles we discussed substitution ciphers. Ie. the plain text was substituted with a different alphabet and that gave us cipher text. Rail Fence Cipher is a member of transposition ciphers family. Plain text is shuffled based on some rule a that gives us cipher text. The alphabet remains the same for both plain text and cipher text. Continue reading
For positive integers it is intuitive: a mod n gives the remainder when a is divided by n.
Example: 7 mod 4 = 3
For negative integers we use the following formula (it actually holds for all integers) a = q . n + r, where we require modulus n > 0.
Example: -11 mod 7 = 3
Monoalphabetic cipher uses a permutation of itself as a key and then substitutes the plaintext using this key.
It gives us n! possibilities of keys. Ie. it is kind of resistant to brute force. Nevertheless, using the statistics and properties of natural language we can analyze the frequency of letters’ occurrence and map corresponding alphabet-key pairs. Simply said the plaintext frequencies translate to ciphertext frequencies. The longer the message the more accurate results we can get for certain letters and then deduct the rest.
The most often letters in English are “e” and “t”, the least “z” and “q”.
Caesar cipher is a substitution cipher. You take the whole alphabet and substitute it with a different alphabet. In Caesar’s case you shift the plaintext alphabet to the right by k letters for encryption. Key k is an arbitrary integer. Continue reading
Let’s consider an encryption algorithm that is “unbreakable” by design. We code it and implement in on certain hardware (provided by 3rd party for example). The Side-Channel attack uses the unintentional leakage of secret information generated by that hardware. For instance, Paul Kocher realized that different plaintexts and keys cause different loads of system resources. Another example could be electro-magnetic radiation generated by the hardware we use. To prevent the first kind of leakage we can obscure the computation, therefore there won’t be any peaks or bottoms in consumption. The second one could be avoided by better EM shields.
Trying all possible keys until the we find the correct one; we need to be able to distinguish the correct key as there might be different keys giving meaningful outcomes. With the key of length n, we have 2n possibilities and on average we are successful after 2n-1 tries. Continue reading
In cryptography, it is a measurement of uncertainty or unpredictability. Continue reading