katana.units.crypto.t9 — T9 phone keypad cipher

T9 Phone keypad Cipher

This unit will decode a T9 cipher and look for flags. This code relies on there being spaces between the T9 ciphers. It can be made cleaner with some regular expression processing, but it has not yet been done…

class katana.units.crypto.t9.Unit(manager: katana.manager.Manager, target: katana.target.Target)

Bases: katana.unit.RegexUnit, 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', 't9']

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

PATTERN = regex.Regex(b'[0-9*]+(\\w([0-9*]+))*', flags=regex.A | regex.V0)
PRIORITY = 50

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

RECURSE_SELF = False

Do not recurse into self

decode_one(number)
evaluate(match)

Run unit tasks given case which was returned from Unit.enumerate. This could happen in any thread or process of execution and should be stateless.