Encryption is the process of translating plain text data into something that appears to be random and meaningless. Decryption is the process of converting ciphertext back to plaintext. The goal of every encryption algorithm is to make it as difficult as possible to decrypt the generated ciphertext without using the key. If a really good encryption algorithm is used, there is no technique significantly better than methodically trying every possible key.
Attached is a program which can encrypt and decrypt msg at a basic level as it only encrypt and decrypt one message Design a program using the same methodology that can encrypt every message user give as input and store the encrypted input messages only. While when output is required the stored encrypted messages are decrypted and the user is shown the decrypted messages only on screen.
#Basic Algorithm
# Encryption
plain_text = “This is a test. ABC abc”
encrypted_text = “”
for c in plain_text:
x = ord(c)
x = x + 1
c2 = chr(x)
encrypted_text = encrypted_text + c2
print(encrypted_text)
#Decryption
encrypted_text = “Uijt!jt!b!uftu/!BCD!bcd”
plain_text = “”
for c in encrypted_text:
x = ord(c)
x = x – 1
c2 = chr(x)
plain_text = plain_text + c2
print(plain_text)