0
votes

I have implemented a simple RSA encryption/decryption program in Python. It works fine when message m is a number. But if I want to use a message like "hello" how do I convert that to plug it into the m**e which takes an integer? It would still need to be reversed for decryption as well. I have tried ord() and encode() to create a long integer string of ASCII numbers, but then I can't reverse it.

m = input("Enter message: ")

# Encryption of m
m = int(m)
c = (m**e) % n
print("Encrypted message = %d" % c)

Thanks!