Algorithm of Reverse Cipher
The algorithm of reverse cipher holds the following features -
- Reverse Cipher uses a pattern of reversing the string of plain text to convert as cipher text.
- The process of encryption and decryption is same.
- To decrypt cipher text, the user simply needs to reverse the cipher text to get the plain text.
message = 'reverse cipher.'
translated = ''
i = len(message) - 1
while i >= 0:
translated = translated + message[i]
i = i - 1
print(%u201CThe cipher text is : %u201C, translated)
Plain text is stored in the variable message and the translated variable is used to store the cipher text created.
The length of plain text is calculated using for loop and with help of index number. The characters are stored in cipher text variable translated which is printed in the last line.