Creating a Reverse Cipher in Python Cryptography

Hacking Truth


Creating a Reverse Cipher in Python Cryptography



Creating a Reverse Cipher in Python Cryptography

For this Cipher blog, we build on a simple plaintext to cipher function creating a function named reverseCipher that accepts one parameter: plaintext and get plaintext as a human readable input from user by using input method . We can then call our function and pass the plaintext into it and print out the return ciphertext. Our method modifies the plaintext so that the ciphertext is the complete reverse: 



import time

def reverseCipher(plaintext):
    ciphertext = ''
    i = len(plaintext) - 1
    while i >=0:
         ciphertext = ciphertext + plaintext[i]
         i = i - 1
    return ciphertext

plaintext = input('Enter your plaintext for encoding : ')
ciphertext = reverseCipher(plaintext)


This code should produce the following result:




Read also - Hashing Cryptography 101 



All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

Post a Comment

* Please Don't Spam Here. All the Comments are Reviewed by Admin.
Post a Comment (0)
Our website uses cookies to enhance your experience. Learn More
Accept !