0% found this document useful (0 votes)
1 views

Encryption Message

The document contains a Python script that encrypts a user-input message using RSA encryption. It defines two prime numbers, p and q, and a public exponent e to calculate n. The script then encrypts the message and outputs both the original and encrypted messages, with an example showing an input of 555 resulting in an encrypted message of 15.0.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Encryption Message

The document contains a Python script that encrypts a user-input message using RSA encryption. It defines two prime numbers, p and q, and a public exponent e to calculate n. The script then encrypts the message and outputs both the original and encrypted messages, with an example showing an input of 555 resulting in an encrypted message of 15.0.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

In [1]: import math

In [5]: message = int(input("Enter the message to be encrypted: "))

p = 11
q = 7
e = 3

n=p*q

def encrypt(me):
en=math.pow(me,e)
c=en%n
print("Encrypted Message is: ",c)
return c

print("Original Message is: ",message)


c=encrypt(message)

Enter the message to be encrypted: 555


Original Message is: 555
Encrypted Message is: 15.0

In [ ]:

You might also like