current position:Home>[MySQL] Part VIII Encryption and Decryption Functions

[MySQL] Part VIII Encryption and Decryption Functions

2023-01-25 11:26:02Tree_wws

【MySQL】Part 8 Encryption and decryption functions



8. Encryption and decryption functions

functionUsage
PASSWORD(str) returns the encrypted version of the string str, a 41-bit long string.The encryption result is irreversible, which is often used for user password encryption. (Cannot be used for versions above 8.0)
MD5(str) Returns the md5-encrypted value of the string str, which is also an encryption method.If the parameter is NULL, NULL will be returned
SHA(str) Calculate and return the encrypted password string from the original plaintext password str. When the parameter is NULL, return NULL.SHA encryption algorithm is more secure than MD5.
ENCODE(value,password_seed)Returns the encrypted value using password_seed as the encrypted password. (Not available for versions above 8.0)
DECODE(value, password_seed)Return to use password_seed as the encrypted password to decrypt the value. (Not available for versions above 8.0)
SELECT PASSWORD('helloworld'),MD5('helloworld'),SHA('helloworld'),ENCODE('123','hello'),DECODE(ENCODE('123','hello'),'hello')FROM DUAL;

Insert image description here


Summary

The above is what I want to talk about today, I hope it will be helpful to everyone!!!

copyright notice
author[Tree_wws],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2023/025/202301251106214574.html

Random recommended