MySQL Tutorial/Encryption Compression Functions/DES ENCRYPT

Материал из SQL эксперт
Перейти к: навигация, поиск

DES_ENCRYPT(str[,{key_num|key_str}]) encrypts the string with the given key using the Triple-DES algorithm.

The encryption key to use is chosen based on the second argument to DES_ENCRYPT(), if one was given:

Argument Description No argument The first key from the DES key file is used. key_num The given key number (0-9) from the DES key file is used. key_str The given key string is used to encrypt str.



mysql>
mysql>
mysql> SELECT DES_ENCRYPT("text");
+---------------------+
| DES_ENCRYPT("text") |
+---------------------+
| �ûùì��ö~?          |
+---------------------+
1 row in set (0.00 sec)
mysql>
mysql>