MIT-Curricular/IS/Lab/Lab1/q4_hill.py

18 lines
No EOL
455 B
Python

def hill_en(ptext,hk):
def hill_de(ptext,hk):
def main():
ptext = input("Kindly enter your desired plaintext: ")
hk = input("Kindly enter the Hill Key: ")
print("Welcome to the Hill cipher.")
print("Plaintext: ", ptext)
print("Hill Key: ", hk)
ctext = hill_en(ptext, hk)
print("Ciphertext: ", ctext)
decrypted_text = hill_de(ctext, hk)
print("Decrypted Text: ", decrypted_text)
if __name__ == '__main__':
main()