PYTHON CRYPTOGRAPHY REVERSE CIPHER














































PYTHON CRYPTOGRAPHY REVERSE CIPHER



Algorithm of Reverse Cipher

The algorithm of reverse cipher holds the following features -

  1. Reverse Cipher uses a pattern of reversing the string of plain text to convert as cipher text.
  2. The process of encryption and decryption is same.
  3. 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)

Explanation

  • 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.

...










Comments