Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 1.13 KB

README.md

File metadata and controls

35 lines (23 loc) · 1.13 KB

Vinegar decryption

Solving Vigenère encryption.

How to use

  • Install python3.
  • Install the following libraries: re, colorama, collections, functools.
  • Run main.py.

How it works

  1. Suppose length of key is k. Calculate Index-of-coincidence (IC) for groups of interval k.

    ---> Key length.

  2. With known key length k, we find character or group of characters that have the highest occurrence. One of them should be letter e.

  3. From that groups of characters, we construct all possible keys.

  4. Then apply some filter methods to get most likely key:

    • Calculate IC in text decrypted by a key.
    • Detect sequence of English words in text decrypted by a key.
    • Vote for which character should be used based on majority vote.
    • Take a random one.
    • Reduce to minimum key.

How to improve

  • Improve method to get key length
  • Add words to wordlist
  • Syntax analysis
  • Optimize with less for-loops
  • Implement algorithms in a faster language (ex: Go, C, Java)