11.07.2015 Views

Cryptography - Sage

Cryptography - Sage

Cryptography - Sage

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sage: (r,s) = (7,5)sage: G = SymmetricGroup(r*s)sage: S = [ i+s*j for i in range(1,s+1) for j in range(r) ]sage: G(S)(2,6,26,24,14,32,20,28,34,30,10,12,22,4,16,8)(3,11,17,13,27,29,5,21,33,25,19,23,9,7,31,15)Elementary CryptanalysisOne important measure of a cryptographic text is the coincidence index. For random text(of uniformly distributed characters) in an alphabet of size 26, the coincidence index isapproximately 0.0385. For English text, this value is closer to 0.0661. Therefore we shouldbe able to pick out text which is a simple substitution or a transposition of English text,since the a coincidence index remains unchanged.The SAGE crypto string functionscoincidence index and frequency distributionprovide functionality for analysis of the ciphertexts in the exercises. Moreover, for a SAGEstring s the k-th decimation of period m for that string is given by s[k::m] (short fors[k:len(s):m]).Exercise 3.1 Complete the deciphering of the Vigenère ciphertext of Section 3.3 . Whatdo you note about the relation between the text and the enciphering or deciphering key? Auseful tool for this task could be the following javascript application for analyzing Vigenèreciphers:http://echidna.maths.usyd.edu.au/ kohel/tch/Crypto/vigenere.htmlConsider those ciphertexts from previous exercises which come from a Vigenère cipher, anddetermine the periods and keys for each of the ciphertext samples.Exercise 3.2 For each of the cryptographic texts from the course web page, compute thecoincidence index of the ciphertexts. Can you tell which come from simple substitution ortransposition ciphers? How could you distinguish the two?105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!