katana.units.crypto.vigenere — Vigenere Cipher

Attempt to decrypt a Vigenere cipher.

You can supply a key argument to use for the Vigenere cipher operation. With the current implementation, if the key is not provided, this unit does not run (it does not attempt to bruteforce it or determine a key on its own).

This unit inherits from the katana.unit.NotEnglishAndPrintableUnit class, as we can expect the data to still be printable characters (letters, numbers and punctuation) but not readable English. It also inherits from the katana.units.crypto.CryptoUnit class to ensure it is not a viable URL or potentially useful file.

class katana.units.crypto.vigenere.Unit(*args, **kwargs)

Bases: katana.unit.NotEnglishAndPrintableUnit, katana.units.crypto.CryptoUnit

BLOCKED_GROUPS = ['crypto']

These are tags for groups to not recurse into. Recursing into other crypto units would be silly.

GROUPS = ['crypto', 'vigenere']

These are “tags” for a unit. Considering it is a Crypto unit, “crypto” is included, and the name of the unit, “vigenere”.

PRIORITY = 60

Priority works with 0 being the highest priority, and 100 being the lowest priority. 50 is the default priorty. This unit has a slightly lower priority.

RECURSE_SELF = False

Do not recurse into self.

evaluate(case: Any) → None

Evaluate the target.

Parameters:case – A case returned by enumerate. For this unit, the enumerate function is not used.
Returns:None. This function should not return any data.
katana.units.crypto.vigenere.vigenere(plaintext, key)

Perform a vigenere cipher.

Parameters:
  • plaintext – The plaintext message to use for the Vigenere cipher.
  • key – The key to use for the Vigenere cipher.
Returns:

The resulting ciphertext from the Vignere cipher operation