Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cryptanalysis of ciphertext using Java

I'm looking for some ideas on an assignment.

I have 7 ciphertext files, all of which are encrypted using the same symmetric key, which is 3 characters long and is alphabetic. No encryption algorithm is provided but the specs state that it is a home-made algorithm and is naive (whatever that means). My objective is to decrypt these files. I'm merely looking for ideas on the attacks which I can carry out on these files.

So far, I have done a frequency analysis, brute force attack to detect Ceasar Cipher, Krasinsky's method to detect Vigenere Cipher, Ciphertext XOR to detect a simple version of the stream cipher. I suspect that the files were encrypted using some mix of ciphers.

By the way, the decrypted plaintext is supposed to contain just a plain message, but the ciphertext reveals the use of over 97 different ASCII symbols!

Any general help, ideas or directions are greatly appreciated! Honestly, I'm not expected to decrypt these files, but then I might as well prove my professor wrong with your help. Thanks!

EDIT

I'm looking for attacks on block or stream ciphers. At least thats what I suspect...

like image 411
Dhruv Gairola Avatar asked Apr 13 '11 20:04

Dhruv Gairola


2 Answers

The famous Enigma machine used 3 character symmetric alphabetic keys. 97 ASCII symbols? ASCII runs from 32 to 126 giving 94 symbols. The \n and \r add two more for 96 and then an end of message marker such as \0 for 97. To put it another way, a naive copy of the early Engima machines (with a fixed reflector) encrypting Windows style textual data would match the clues very well.

The enigma machine has some known flaws. If your professor was being exceptionally kind he will have replicated the weak system used by the German Navy early on. This was to encrypt every message with a one time key, but then to allow decryption to transmit the one time key twice at the start of the message encrypted using a standard key. By transmitting it twice they provided extra context to the cryptanalysis.

The second well known flaw was that a character never maps to itself. Thus if you have a potential plain text no character will match.

It is possible to brute force Enigma if you know what the rotors and reflector look like. Without knowing that you have around 10^15 possibilities to explore in this case.

like image 72
Simon G. Avatar answered Oct 04 '22 03:10

Simon G.


Why not go ahead and get started with brute forcing all of the 26**3 possibilities for each of the most popular symmetric key algorithms:

  • Twofish
  • Serpent
  • AES (Rijndael)
  • Blowfish
  • CAST5

And any others you can find.

like image 35
Daniel DiPaolo Avatar answered Oct 04 '22 01:10

Daniel DiPaolo