Quantcast
Viewing all articles
Browse latest Browse all 14155

Encrypt and Decrypt functions in python

def encrypt(string):    reversed_string = string\[::-1\]    encrypted_string = reversed_string.replace('e', '3').replace('a', '4')    return encrypted_stringdef decrypt(string):    decrypted_password = string.replace('3', 'e').replace('4', 'a')    reversed_string = decrypted_password\[::-1\]    return reversed_stringstring = input("Insert a message: ")encrypted_word = encrypt(string)print("Encrypted Message: ", encrypted_word)decrypted_word = decrypt(encrypted_word)print("Decrypted Message: ", decrypted_word)

This functions are correct? I don't know if the encrypted function is 100% right


Viewing all articles
Browse latest Browse all 14155

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>