This project contains a text-to-text model designed to decrypt English text encoded using a substitution cipher.
In a substitution cipher, each letter in the plaintext is replaced by a corresponding, unique letter to form the ciphertext.
The model leverages statistical and linguistic properties of English to make educated guesses about the letter substitutions,
aiming to recover the original plaintext message.
This model is for monoalphabetic English substitution ciphers and it outputs decoded text.
1#Load the model and tokenizer
2cipher_text = "" #Encoded text here!
3inputs = tokenizer(cipher_text, return_tensors="pt", padding=True, truncation=True, max_length=256).to(device)
4outputs = model.generate(inputs["input_ids"], max_length=256)
5decoded_text = tokenizer.decode(outputs[0], skip_special_tokens=True)