Lecture 7 Transposition Cipher and Group
Lecture 7 Transposition Cipher and Group
Ciphers
Courtesy:
Behrouz A Forouzan, Debdeep Mukhopadhyay
and William Stallings
Cryptanalysis
❑ Simple transposition ciphers, which were used in the past, are keyless.
❑ First Method: Text is written into a table column by column and then transmitted row by row.
❑ Second Method: Text is written into a table row by row and then transmitted column by
column.
Example
A good example of a keyless cipher using the first method is the rail fence cipher.
The ciphertext is created reading the pattern row by row. For example, to send the
message “Meet me at the park” to Bob, Alice writes
Alice and Bob can agree on the number of columns and use the second method.
Alice writes the same plaintext, row by row, in a table of four columns.
of columns.
Example
The cipher in above Example is actually a transposition cipher. The following
shows the permutation of each character in the plaintext into the ciphertext
based on the positions.
❑ The second character in the plaintext has moved to the fifth position in the
ciphertext; the third character has moved to the ninth position; and so on.
❑ Although the characters are permuted, there is a pattern in the permutation:
(01, 05, 09, 13), (02, 06, 10, 13), (03, 07, 11, 15), and (08, 12). In each section,
the difference between the two adjacent numbers is 4.
Keyed Transposition Ciphers
The keys are stored in tables with one entry for each column. The entry shows the source
column number; the destination column number is understood from the position of the entry.
Decryption matrix is the inverse of the encryption matrix – no need to apply invert – Encryption
key matrix can be simply transposed to get Decryption matrix.
Cryptanalysis of Transposition Cipher
❑Brute-Force Attack:
Pattern
attack can
be
avoided.
Single
letter
frequency
analysis is
still is able
to do.
Stream and Block Ciphers
• Symmetric ciphers divided into two broad categories: stream
ciphers and block ciphers.
• Stream Ciphers
• Call the plaintext stream P, the ciphertext stream C, and the key
stream K.
K:
▪ Stream of predetermined
values
▪ Created one value at a
time using an algorithm
▪ May depend on previous
Plaintext/Ciphertext
▪ May depend on Previous
key values
Example
The monoalphabetic substitution ciphers discussed in this chapter are also stream ciphers.
However, each value of the key stream in this case is the mapping of the current plaintext
character to the corresponding ciphertext character in the mapping table.
Example
Vigenere ciphers are also stream ciphers according to the definition. In this case, the key stream is a repetition
of m values, where m is the size of the keyword. In other words,
Example
▪ We can establish a criterion to divide stream ciphers based on their key streams. We can say that a stream
cipher is a monoalphabetic cipher if the value of ki does not depend on the position of the plaintext character
in the plaintext stream; otherwise, the cipher is polyalphabetic.
▪ Additive ciphers are definitely monoalphabetic because ki in the key stream is fixed; it does not depend on
the position of the character in the plaintext.
▪ Monoalphabetic substitution ciphers are monoalphabetic because ki does not depend on the position of the
corresponding character in the plaintext stream; it depends only on the value of the plaintext character.
▪ Vigenere ciphers are polyalphabetic ciphers because ki definitely depends on the position of the plaintext
character. However, the dependency is cyclic. The key is the same for two characters m positions apart.
Block Ciphers
In a block cipher, a group of plaintext symbols of size m (m > 1) are encrypted together creating
a group of ciphertext of the same size. A single key is used to encrypt the whole block even if
the key is made of multiple values.
Example
• Playfair ciphers are block ciphers. The size of the block is m = 2. Two characters are encrypted
together.
• Hill ciphers are block ciphers. A block of plaintext, of size 2 or more is encrypted together using a
single key (a matrix). In these ciphers, the value of each character in the ciphertext depends on all the
values of the characters in the plaintext. Although the key is made of m × m values, it is considered as
a single key.
• From the definition of the block cipher, it is clear that every block cipher is a polyalphabetic cipher
because each character in a ciphertext block depends on all characters in the plaintext block.
Combination
❑ In practice, blocks of plaintext are encrypted individually, but they use a
stream of keys to encrypt the whole message block by block.
❑ Each block uses a different key that may be generated before or during
the encryption process.
Algebraic Structures
ALGEBRAIC STRUCTURES
• Cryptography requires sets of integers and specific operations
that are defined for those sets.
• The combination of the set and the operations that are
applied to the elements of the set is called an algebraic
structure.
Group
• A group G, sometimes denoted by {G, ·} is a set of elements
with a binary operation, denoted by ·, that associates to each
ordered pair (a, b) of elements in G an element (a · b) in G,
such that the following axioms are obeyed:
Example
The set of residue integers with the addition operator, G = < Zn , +>, is a
commutative group. We can perform addition and subtraction on the elements
of this set without moving out of the set.
Example The set Zn* with the multiplication operator, G = <Zn*, ×>, is also
an abelian group.
Example Let us define a set G = < {a, b, c, d}, •> and the operation as shown
in Table.
Subgroups
• A subset H of a group G is a subgroup of G if H itself is a group
with respect to the operation on G.
• In other words, if G=<S, · > is a group, H=<T, ·> is a group
under the same operation and T is a nonempty subset of S,
then H is a subgroup of G. The above definition implies that:
Cyclic Subgroups If a subgroup of a group can be generated using the power of an element, the
subgroup is called the cyclic subgroup. The term power here means repeatedly
applying the group operation to the element:
Example Four cyclic subgroups can be made from the group G = <Z6, +>. They are H1 = <{0}, +>, H2 =
<{0, 2, 4}, +>, H3 = <{0, 3}, +>, and H4 = G.
Three cyclic subgroups can be made from the group
Example
G =<Z10∗, ×>. G has only four elements: 1, 3, 7, and 9. The cyclic subgroups are H1 = <{1}, ×>, H2
= <{1, 9}, ×>, and H3 = G.
Cyclic Groups • A cyclic group is a group that is its own cyclic subgroup.
• In previous example, the group G has a cyclic subgroup H5 = G. This means that the
group G is a cyclic subgroup.
• In this case, the element that generates the cyclic subgroup can also generate the
group itself. This element is referred to as a generator.
• If g is a generator, the elements in a finite cyclic group can be written as
In the group G = <Z6, +>, the orders of the elements are: ord(0) = 1, ord(1) = 6,ord(2) = 3,ord(3) = 2, ord(4) =
3, ord(5) = 6.
Example
In the group G = <Z10*, ×>, the orders of the elements are: ord(1) = 1, ord(3) = 4, ord(7) = 4, ord(9) = 2.
Thank You..!!