Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

How Row Transposition Encryption Algorithm Work

Fri Feb 08, 2008 8:20 pm

How Row Transposition works?
Transposition Ciphers

  • transposition or permutation ciphers hide the message contents by rearranging the order of the letters

Scytale cipher

  • an early Greek transposition cipher
  • a strip of paper was wound round a staff
  • message written along staff in rows, then paper removed
  • leaving a strip of seemingly random letters



Reverse cipher

write the message backwards
Code:
Plain:   I CAME I SAW I CONQUERED
Cipher:   DEREU QNOCI WASIE MACI



Rail Fence cipher

  • write message with letters on alternate rows
  • read off cipher row by row

Code:
Plain:   I A E S W C N U R D
         C M I A I O Q E E
Cipher:   IAESW CNURD CMIAI OQEE



Row Transposition ciphers

  • In general write message in a number of columns and then use some rule to read off from these columns
  • key could be a series of number being the order to: read off the cipher; or write in the plain-text

Code:
Plain:   THESIMPLESTPOSSIBLETRANSPOSITIONSXX
Key (R):      2 5 4 1 3   
Key (W):                           4 1 5 3 2    

              T H E S I      S T I E H    
              M P L E S      E M S L P    
              T P O S S      S T S O P    
              I B L E T      E I T L B    
              R A N S P      S R P N A    
              O S I T I      T O I I S    
              O N S X X      X O X S N
Cipher:   STIEH EMSLP STSOP EITLB SRPNA TOIIS XOXSN




or can use a word, with letter order giving sequence: to write in the plain-text; or read off the cipher
Code:
Plain:   ACONVENIENTWAYTOEXPRESSTHEPERMUTATION
Key (W):      C O M P U T E R
Key (W):      1 4 3 5 8 7 2 6
   
              A N O V I N C E
              E W T A O T N Y
              H E P R T U E M
              A O I N Z Z T Z

Cipher:       ANOVI NCEEW TAOTN YHEPR TUEMA OINZZ TZ



key idea for row transposition ciphers is that message is in groups that have the letters reordered in each
Exercise using key sorcery (to read out) encipher:

Code:
Key(R):   sorcery => 6 3 4 1 2 5 7

laser beams can be modulated to carry more intelligence than radio waves

gives:

Code:
erasb lecam snabd umole atoed ctamo ryrre elntl iicee ntgha dnria oesav w


Decryption consists of:
  • writing the message out in columns
  • reading off the message by reordering columns
  • (use T command in krypto, uses read out keys)
hint - its not a good idea to leave message in groups matching the size of your key!

Cryptanalysis of row transposition ciphers

A frequency count will show a normal language profile hence know have letters rearranged basic idea is to guess period, then look at all possible permutations in period, and search for common patterns (eg t command in krypto)
  • use lists of common pairs & triples & other features

To determine the complexity of this cipher, we can calculate its unicity distance
Given blocks of period d, there are d! keys, hence
Code:
N = F(H(K),D) = F(log_(2)d!,D) = F(d log_(2)(d/e),3.2)




Block (Columnar) Transposition ciphers
Another group of ciphers are block (columnar) transposition ciphers where the message is written in rows, but read off by columns in order given by key (use B command in krypto) for ease of recovery may insist matrix is filled :
Code:
Key(R):       s o r c e r y        s o r c e r y
Key(R):       6 3 4 1 2 5 7        6 3 4 1 2 5 7

              l a s e r b e        l a s e r b e
              a m s c a n b        a m s c a n b
              e m o d u l a        e m o d u l a
              t e d t o c a        t e d t o c a
              r r y m o r e        r r y m o r e
              i n t e l l i        i n t e l l i
              g e n c e t h        g e n c e t h
              a n r a d i o        a n r a d i o
              w a v e s            w a v e s q r


Giving ciphertext (by reading off cols 4, 5, 2, 3, 6, 1, 7)

Code:
ecdtm ecaer auool edsam merne nasso dytnr vbnlc rltiq laetr igawe baaei hor


Decryption consists of:

  • calculating how many rows there are (by dividing message length by key length)
  • then write out message down columns in order given by key

Find code for Row Transposition Here ( Java and C#)
Moved to :
http://www.codemiles.com/finished-projects/row-transposition-cipher-encryption-decryption-java-t10766.html

http://www.codemiles.com/c/row-transposition-cipher-encryption-decryption-csharp-c-t658.html

For information on lots of simple substitution and permutation ciphers see:

A. Sinkov "Elementary Cryptanalysis", New Mathematical Library, Random House, 1968* other simple transposition ciphers include:


Attachments
Transpositions.rar
(89.84 KiB) Downloaded 3281 times

Post a reply
  Related Posts  to : How Row Transposition Encryption Algorithm Work
 program for transposition encryption     -  
 program for transposition encryption     -  
 Row Transposition cipher - encryption-decryption Csharp(C#)     -  
 Row Transposition cipher - encryption-decryption java     -  
 Encryption Algorithm{Data Encryption Standard}     -  
 RSA encryption decryption cipher algorithm java     -  
 Easy Copy Paste Work From Home - Online Home Based Work     -  
 Encryption and Decryption encryption Affine cipher code     -  
 Does not Work IE8     -  
 Cause to Work from Home     -