katana.units.crypto.quipqiup
— Online Substitution Cipher solver¶
Substituion cipher solver, by outsourcing to https://quipqiup.com/.
The gist of this code is ripped from https://github.com/rallip/substituteBreaker. The unit takes the target, and if it does not look English text but it is clearly printable characters, it offers it to quipqiup online.
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.
Note
This unit does not recurse. It simply looks for flags in the output of quipqiup’s best potential solution. Note that Katana might find flags that are not in the specific flag format, but also denoted in a “the flag is:” structure.
-
class
katana.units.crypto.quipqiup.
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', 'quipquip', 'substitution'] These are “tags” for a unit. Considering it is a Crypto unit, “crypto” is included, and the name of the unit and some other related topics.
-
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 This unit does not recurse. It simply looks for flags in the output of quipqiup’s best potential solution.
-
evaluate
(case: Any) → None Evaluate the target.
Parameters: case – A case returned by enumerate
. For this unit, theenumerate
function is not used.Returns: None. This function should not return any data.
-
-
katana.units.crypto.quipqiup.
decodeSubstitute
(cipher: str, time=3, spaces=True) → str This is stolen from https://github.com/rallip/substituteBreaker All it does is use the
requests
module to send the ciphertext to quipqiup and returns the results as a string.