I have to encrypt a user-provided plaintext using Caesar Cipher. Converting each plaintext character to its ASCII (integer) value and store in a list. I have done like this
print("This program uses a Caesar Cipher to encrypt a plaintext message using the encryption key you provide.")
plaintext = input("Enter the message to be encrypted:")
plaintext = plaintext.upper()
n = eval(input("Enter an integer for an encrytion key:"))
ascii_list = []
# encipher
ciphertext = ""
for x in range(len(plaintext)):
ascii_list[x] = plaintext (ascii_list) + n %26
print()
But error appears as like this:
TypeError: 'str' object is not callable
I want the result to come out:
This program uses a Caesar Cipher to encrypt a plaintext message using the encryption key you provide.
Enter the message to be encrypted: Boiler Up Baby!
Enter an integer for an encrytion key: 1868
The fully encoded message is: CWOTFZ&]QCHICa'
I have tried so many different ways but the result does not come out.