I am trying to do basic encryption in Python, in below program I encrypt whatever user types in, and then I am displaying it back to the user after decryption. I am using the pyCrypto library which I downloaded from here: http://www.voidspace.org.uk/python/modules.shtml#pycrypto
Below is the code I have written so far:
from Crypto.Cipher import AES
AES_key = AES.new('This is a key')
#message = "The answer is no"
message = input("Enter text:")
ciphertext = AES_key.encrypt(message)
print (ciphertext)
decrypted_message = AES_key.decrypt(ciphertext)
print (decrypted_message)
The problem is when I taken input from the user, my code does not work, but when I give static input the one which I have commented my code works fine.
Can anyone please help what should I do so that my accepts user input and encrypts it?