Affine#
Encrypt#
- crypton.affine.src.affine_encrypt.encrypt(plain_text: str, a: int, b: int, space: str) str#
Encrypts the given text with given a, b and space
- Parameters
plain_text (str) – Text you want to encrypt
a (int) – An integer that corresponds to the A parameter in affine cypher
b (int) – An integer that corresponds to the B parameter in affine cypher
space (str) – Target space
- Returns
Encrypted text in string form
- Return type
str
Decrypt#
- crypton.affine.src.affine_decrypt.decrypt(plain_text: str, a: int, b: int, space: str) str#
Decrypts the given text with given a, b and space
- Parameters
plain_text (str) – Text you want to decrypt
a (int) – An integer that corresponds to the A parameter in affine cypher
b (int) – An integer that corresponds to the B parameter in affine cypher
space (str) – Target space
- Returns
Decrypted text in string form
- Return type
str
Helper#
- crypton.affine.src.affine_helper.get_cryption_functions(*args, **kwargs) Tuple[Callable, Callable]#
Returns encrypt and decrypt functions with the same a, b, and space
- Parameters
args – Arguments
kwargs – Keyword Arguments
- Returns
Encrypt and Decrypt functions
- Return type
(Function, Function)