Encryption and Decryption using Python where the user can encrypt and decrypt the text they want. First by clicking on Create Secret Messages a window will pop up with two text boxes where the user type the text they want to encrypt then type the key and click on encrypt and it will show the encrypted message, for the decryption it is the same but the user should decrypt a message that is encrypted earlier and choose the decrypt option.
pip install pybase64
pip install mysql-connector-python
pip install mysql-connector
Here is a database that store the encryption and decryption messages
def stor_data():
connection = mysql.connector.connect(host='127.0.0.1',
database='pypro',
user='root',
password='12345678')
mycursor = connection.cursor()
sql = "INSERT INTO info (text1,text2) VALUES (%s,%s)"
info = (str(message2), str(encry))
mycursor.execute(sql, info)
connection.commit()
def stor_data2():
connection = mysql.connector.connect(host='127.0.0.1',
database='pypro',
user='root',
password='12345678')
mycursor = connection.cursor()
sql = "INSERT INTO info (text1,text2) VALUES (%s,%s)"
info = (str(message1), str(decry))
mycursor.execute(sql, info)
connection.commit()