1
$\begingroup$

I've begun a course in crypto on coursera and the first homework was writing a vigenere(xor) cracker. It works, which was a rush :) but it makes one core assumption, one has encrypted a natural language text that the script can use frequency analysis on. Therefore doesn't work if one encrypted an image or a compressed file. How does one do it if frequency analysis isn't an option?

$\endgroup$
  • $\begingroup$ Frequency analysis can also work other formats. Compressed files and images typically contain more-or-less fixed headers, that will probably help. $\endgroup$ – Aleph May 15 '16 at 10:59
1
$\begingroup$

AFAIK vigenere cipher is a plain subsitution algorithm with arbitrary key length, destroying statistical patterns (f.e. of natural languages) but not conducting any transposition.

Btw. a classic approach to crack a vigenere cipher is the Kasiki-Test (https://en.wikipedia.org/wiki/Kasiski_examination) which might give you information reagrding the key length.

If you try to decrypt a file format (jpeg, gif, zip etc.) you actually know at least the first bytes (fileheader) as they are defined by convention: f.e. a zip file always starts with 0x04034b50 (https://en.wikipedia.org/wiki/Zip_%28file_format%29) which gives you the first 4 bytes for your decryption table.

$\endgroup$
  • $\begingroup$ This answer goes from worst to best. That the Vigenère cipher destroys statistical pattern is a strong falsehood. The Kasiki test depends on it. That there is known plaintext for many encoding formats is on the other hand completely true and a good answer. Please try and format your questions and answers to the best of your ability (the Kasiki test is actually a test for a Greek cucumber recipe). Try and avoid acronyms such as AFAIK, BTW, f.e. et cetera. $\endgroup$ – Maarten Bodewes May 15 '16 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.