Deconstructing columnar transposition ciphers Robert Talbert, PhD. Department of Mathematics Grand Valley State University [email protected]Twitter: @RobertTalbert Google+: google.com/+RobertTalbert 11.07.2013 R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 1 / 33
This talk explores some of the properties of the columnar transposition cipher, a classical encryption technique that uses a rectangular grid structure to shuffle the characters of the plaintext. This means that the columnar transposition cipher is a permutation, and the group theoretic structure of the cipher admits some interesting features.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Deconstructing columnar transposition ciphers
Robert Talbert, PhD.
Department of MathematicsGrand Valley State University
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 16 / 33
Will repeated encryption using a CTC always eventually lead back to theplaintext?YES because of the cyclical nature of permutations.Example: π3,9 = (1, 3)(2, 6)(5, 7)
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 16 / 33
Will repeated encryption using a CTC always eventually lead back to theplaintext?YES because of the cyclical nature of permutations.Example: π3,9 = (1, 3)(2, 6)(5, 7)
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 16 / 33
Definition
The order of the columnar transposition πC ,L is the smallest positiveinteger such that
πC ,L ◦ πC ,L ◦ · · · ◦ πC ,L︸ ︷︷ ︸k times
= πkC ,L = identity function
Fact
Every permutation has a finite order, and that order is the least commonmultiple of the lengths of the cycles in its disjoint cycle factorization.
Can we determine the order of πC ,L using only the values of C and L?
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 17 / 33
Definition
The order of the columnar transposition πC ,L is the smallest positiveinteger such that
πC ,L ◦ πC ,L ◦ · · · ◦ πC ,L︸ ︷︷ ︸k times
= πkC ,L = identity function
Fact
Every permutation has a finite order, and that order is the least commonmultiple of the lengths of the cycles in its disjoint cycle factorization.
Can we determine the order of πC ,L using only the values of C and L?
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 17 / 33
Formula for πC ,L
Results following are from
R. Talbert, “The cycle structure and order of the rail fence cipher”,Cryptologia, 30(2):159—172, 2006
Theorem (The Big Formula)
Let πC ,L be the permutation underlying a columnar transposition cipherwith C columns and text length L. Let 0 ≤ n < L, n′ = nmodC , andL′ = LmodC . Then:
πC ,L(n) =
n − n′
C+ n′
(⌈L
C
⌉)− (n′ − L′) if L′ 6= 0 and n′ > L′
n − n′
C+ n′
(⌈L
C
⌉)otherwise
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 18 / 33
Illustration of The Big Formula: π4,26
0
11
13
25
C
�L/C�
π4,26(13) = 7 + 3 = 10
π4,26(11) = (3(7)− 1) + 2 = 22
n′ = number of columns preceding thecolumn containing n
n′dL/Ce = number of entries countedin columns preceding n
n − n′ = position of first character inn’s row
(n − n′)/C = number of rows precedingrow containing n
(n − n′)/C + n′dL/Ce = endingposition of n if no blanks encountered.
L′ = number of blanks in last row
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 19 / 33
The rail fence cipher
CTC with 2 columns = π2,L, the rail fence cipher.
Since C = 2, n′ and L′ are 0 or 1, so:
Theorem (RFC Formula)
Let π2,L be the permutation for a rail fence cipher on a plaintext of lengthL. Let n be an integer with 0 ≤ n < L. Then:
π2,L(n) =
n
2n even
n + L
2n odd, L odd
n + L− 1
2n odd, L even
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 20 / 33
The initial cycle
Definition
The initial cycle of πC ,L is the cycle in the decomposition of πC ,L thatcontains the number 1.
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 23 / 33
Theorem
Suppose L is odd. If γ is a cycle of π2,L, then the length of γ divides thelength of the initial cycle, and hence the order of π2,L is the length of theinitial cycle.
Proof: Let orb(1) denote the initial cycle of π2,L. This is a group withtypical element πk2,L(1). Define a group action of orb(1) on a cycle γ ofπ2,L:
πk2,L(1) · x = πk2,L(x)
Exercise: This really is a group action, and if x ∈ γ, then
Fx = {g ∈ orb(1) : g · x = x mod L}
is a subgroup of orb(1). Classical group theory implies |orb(1)/Fx | = |γ|.
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 24 / 33
Initial cycle does not end in descending powers of 3 mod 19
Initial cycle does not act nicely on the long cycle
It’s not currently known exactly how the cycle structure of πC ,L isorganized if C > 2.
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 25 / 33
Question 2: Are there characters in the message that are fixed by a CTC?
YES:
The first character is always fixed.
The last character is fixed if and only if C divides L.
But what about “nontrivial” fixed points?
Research with Beth Bjorkman (GVSU mathematics undergrad): “Fixedpoints of columnar transposition ciphers”
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 26 / 33
Question 2: Are there characters in the message that are fixed by a CTC?
YES:
The first character is always fixed.
The last character is fixed if and only if C divides L.
But what about “nontrivial” fixed points?
Research with Beth Bjorkman (GVSU mathematics undergrad): “Fixedpoints of columnar transposition ciphers”
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 26 / 33
Question 2: Are there characters in the message that are fixed by a CTC?
YES:
The first character is always fixed.
The last character is fixed if and only if C divides L.
But what about “nontrivial” fixed points?
Research with Beth Bjorkman (GVSU mathematics undergrad): “Fixedpoints of columnar transposition ciphers”
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 26 / 33
Where nontrivial fixed points don’t appear
Each column of the enciphering grid for πC ,L can contain at most onefixed point.
Corollary: If n is a nonzero character position and C divides n, then nis not fixed.
Corollary: If n is a character position and n ≡ −1 (mod C ), then n isnot fixed if C divides L; and if C does not divide L, n is fixed if andonly if n = L− 1.
Several other formulas lead to a constant-time algorithm forlocating fixed points. (→ Demo)
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 27 / 33
What’s not known (yet)
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 28 / 33
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 31 / 33
Extension questions
Both are due to David Austin (GVSU).
Suppose C1 6= C2. Does the composition
πC2,L ◦ πC1,L
reduce to πC ,L for some C?Partial answer: Not always.
π3,9 ◦ π2,9 = (1, 6)(2, 3, 5, 8, 4) 6= πi ,9 ∀i
Extend the CTC idea to a 3-dimensional array. Is this cipherequivalent to a 2-dimensional columnar transposition? What if weused higher-dimensional arrays?
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 32 / 33
Thank you
R. Talbert (GVSU) Deconstructing CTCs 11.07.2013 33 / 33