The Transposition Helper was developed while studying cryptography to help with an assessment item. This program was not the assessment item itself, but was used to help solve a transposition cipher in the assessment. The assessment itself primarily involved analyzing multiple cipher texts to identify how each one was encrypted and then decrypting them to obtain clear readable plain texts.
The transposition helper reads in ‘cipher text’ from a file and outputs every possible key and associated ‘plain text’ equivalent of the ‘cipher text’ for a given block size. As such it uses a brute force method, while there are faster, more optimized, means for find a transposition cipher key, I deemed it unnecessary to spend the time developing such an algorithm as this program met my requirements and solved my cipher text. (As a side note, I received a seven (7) for Cryptology, seven being the highest possible achievement on a scale of one to seven).
The Transposition Helper was tested up to a period (or block size) of 11, it therefore generated 11!(factorial) keys, which is approximately 40 million keys, but did take some time to finish. Running the Transposition Helper up to a block size of 9 can be completed relatively fast.
A Transposition Helper example:
The following cipher text
eThu qkicr bnowo ffx lel
when passed through the Transposition Helper with a block size of three (3) would generate the following output into a textfile.
012
eThu qkicr bnowo ffx lel
021
ehTuq kcirb nwoof f xlle
102
Teh uqikc rbonw ofxf ell
120
The quick brown fox fell
201
heTqu ckibr wnofo fxlle
210
hTeq ucikb rwonf o xflel
Thus allowing us to see that the ‘cipher text’ could be decrypted using the key 120 (or BCA).
eThu qkicr bnowo ffx lel ==> The quick brown fox fell
Some Transposition Cipher Background Info:
Decryption can be done manually first by breaking the cipher text into blocks and then anagramming.
A transposition cipher permutes characters usually in a fixed period (d) and permutation (f).
Generally transposition ciphers can permute rows or columns and output in row or column order, in the above program only permutation of rows and output in row were considered.
Each block of characters is re-ordered using the permutation.
There are d! permutations of length d. (Remember that d! = d X (d – 1)X (d – 2) X . . . X 2 X 1)
When d = 10 there are thus 3,628,800 keys.
A simple example:
Let the period d = 4, and the permutation f = (4 1 2 3).
Plaintext: CRYP TOGR APHY
Ciphertext: PCRY RTOG YAPH
To decrypt apply the inverse permutation:
f-1 = (2 3 4 1)
