Get the App
SLTechnology News&Howtos  ›  Database  › 

How MySQL uses encryption functions

Shulou Source: shulou.com Published: 2022-05-31 10:53:54 10月12日 Update

Editor to share with you how to use MySQL encryption function, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Encryption function

Command: md5 (data)

Function: used to encrypt data

Application scenarios: encryption, some private data, such as bank card number, ID card, etc., need to store ciphertext (of course, it is not recommended to use database layer encryption, it should be encrypted at the application layer)

Example:

Mysql > select md5 ("andyqian") +-- + | md5 ("andyqian") | +-- + | 8a6f60827608e7f1ae29d1abcecffc3a | +-+ 1 row in set (0.00 sec)

Note: if the data in your database is still in clear text, you can use the database encryption algorithm to encrypt it at this time.

For example: (demonstration only):

Update t_base_user set name=md5 (name), updated_time=now () where id=1

The supported encryption functions are:

Md5 () des_encrypt (encryption) / des_decrypt (decryption); sha1 () password () and so on are all the contents of this article entitled "how MySQL uses encryption functions". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Encryption data functions databases articles content applications not much events functions examples card numbers commands scenarios most ciphertext application layer suggestions plaintext more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Shulou Technology Linux macOS MySQL