MySQL encryption and decryption examples Data encryption and decryption are very important in the security field. For programmers, storing user passwords in ciphertext in the database is of great significance to intruders who steal user privacy. When building a table, pay attention to the type of field. As shown in the following figure: Insert encrypted data into the table The above insert statement has three fields, "Username", "Password" and "Encrypted Password". The AES_ENCRYPT() function requires a "key" to assist with encryption, and it is also required for decryption (remember this!). The following is a screenshot of the data in the table: The above insert statement has three fields, "Username", "Password" and "Encrypted Password". The AES_ENCRYPT() function requires a "key" to assist with encryption, and it is also required for decryption (remember this!). The following is a screenshot of the data in the table: Query encrypted data from the table The query above uses the AES_DECRYPT() function. Here are the results: In the above screenshot, we can see that the values of the "pasword" and "decryptedpassword" fields are the same, that is, you have decrypted the user password. Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: Share 12 commonly used Loaders in Webpack (Summary)
>>: How to upload the jar package to nexus via the web page
What are HTTP Headers HTTP is an abbreviation of ...
Execute Command docker run -d --name consul -p 85...
Look at the code first #/bin/sh datename=$(date +...
Table of contents 1. What is a closure? 2. The ro...
principle Set a shadow on the element when hoveri...
1. The difference between the command > and &g...
Slow log query function The main function of slow...
CSS style: Copy code The code is as follows: <s...
Click here to return to the 123WORDPRESS.COM HTML ...
1. Introduction The main value that SELinux bring...
Nginx does not support nested if statements, nor ...
1. Background In the context of rapid updates and...
1. Preparation before installation 1. Download th...
To achieve the plus sign effect shown below: To a...
Solution to the problem of automatic disconnectio...