Skip to content

alitonia/vinegar_code

Repository files navigation

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages