A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3resource.com/mysql/encryption-and-compression-functions/encrypt().php below:

Website Navigation


MySQL encrypt() - w3resource

MySQL ENCRYPT() functionLast update on August 08 2023 12:40:25 (UTC/GMT +8 hours) ENCRYPT() function

MySQL ENCRYPT() encrypts a string using the Unix crypt() system call. The function returns a binary string.

Since the function is based on Unix crypt() system call, on Windows systems, it will return NULL.

Syntax:

ENCRYPT(string, salt)

Arguments

Name Description string A string which is to be encrypted. salt A string with at least two characters. If salt is less than two characters, the function will return NULL. If this argument is not set, the function uses a random value for encryption.

Syntax Diagram:

MySQL Version: 8.0

Example:

Code:

SELECT ENCRYPT('w3resource', 'encode');

Explanation

The above MySQL statement encrypts w3resource with encoding.

Output:

mysql> SELECT ENCRYPT('w3resource', 'encode');
+---------------------------------+
| ENCRYPT('w3resource', 'encode') |
+---------------------------------+
| NULL                            | 
+---------------------------------+
1 row in set (0.00 sec)

Previous: ENCODE()
Next: MD5()




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4