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.

Examples of CryptanalysisLet’s begin with the substitution ciphertext constructed previously:QWMMPQDVKUVFDTXJQVDBOPIDUHDQQUGDLAMWJGXBGURRBPBURMKULDVXOOKUJUOVDJQDGBWHLDJQQMUODQUBIMWBOVWUVXPBUBIOKUBGXBGURROKUJUOVDJQVPWMMDJOUQDVKDBVKDCDAQXEDFKXOKLPWBIQVKDQDOWJXVAPTVKDQAQVDHXQURMKULDVXOOKUJUOVDJQVKDJDTPJDVKDVPVURBWHLDJPTCDAQXQPTDBPJHPWQQXEDBDNDJVKDRDQQFDFXRRQDDVKUVQXHMRDQWLQVXVWVXPBXQNDJAQWQODMVXLRDVPOJAMVUBURAVXOUVVUOCQWe find the following character counts, scaled to that of a 1000 character input text.A 24.0964B 54.2169C 9.0361D 129.5181E 6.0241F 12.0482G 18.0723H 18.0723I 12.0482J 54.2169K 51.2048L 24.0964M 36.1446N 6.0241O 57.2289P 45.1807Q 96.3855R 39.1566S 0T 15.0602U 81.3253V 99.3976W 39.1566X 57.2289Y 0Z 0The distributions look like a frequency preserving substitution cipher. We guess thatthe enciphering takes E ↦→ D and T ↦→ V or T ↦→ Q. The most frequent characters are D, V,Q, V, U, O, J, K, B and E, N, S, Y, Z are of lowest frequency.andEquating high frequency and low frequency characters, we might first guess{E, I, O, A, T, N, R, S} ↦→ {D, V, Q, U, O, J, K, B}{J, K, Q, X, Z} ↦→ {E, N, S, Y, Z}How would you go about reconstructing the entire text?Index of CoincidenceIn the 1920’s William Friedman introduced the index of coincidence as a measure of thevariation of character frequencies in text from a uniform distribution. The index of coincidenceof a text space (e.g. that of all plaintext or ciphertext) is defined to be theprobability that two randomly chosen characters are equal. In a language over an alphabet3.2. Cryptanalysis by Frequency Analysis 21

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

Saved successfully!

Ooh no, something went wrong!