A Hill Cipher Cracker that performs automated crib dragging given a known plaintext and a ciphertext.
Note: This script only supports decryption of ciphertexts encrypted with a 3x3 key matrix.
This script has to be run with SageMath(Sage).
-
Clone this repository.
-
Set up the script. To specify the ciphertext and the known plaintext, set the
ciphertext
andKPT
variables, respectively.To specify a custom character set for the Hill Cipher, modify the contents of the
trans_letter_to_num
dictionary. Note that this dictionary must be one-to-one. If your use case is different, you will have to modify the script. The modulo for the Hill Cipher is automatically determined by the length of this dictionary. -
Run
sage cribdrag.sage
This script was written by Chesley Tan during the HSCTF cybersecurity/hacking competition.