ENCRYPT()

Overview

Encrypts a string with the Unix crypt() system call.

USAGE

ENCRYPT(string[, salt])

Argument Name

Description

string

The string to encrypt

salt

Optional. The salt to use for the crypt() call

DETAILS

ENCRYPT() is an encryption function that returns the UNIX crypt() encoding of a string.

If the optional 2-character salt argument is not provided, a random salt value will be used. If more than 2 characters are specified for the salt, the first 2 characters are used.

A NULL is returned if either argument is NULL or if the salt is fewer than 2 characters.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT ENCRYPT('secret', 'xy');
+-------------------------+
| ENCRYPT('secret', 'xy') |
+-------------------------+
| xy/gRonXQz8UE           |
+-------------------------+
SELECT ENCRYPT('secret', 'x');
+------------------------+
| ENCRYPT('secret', 'x') |
+------------------------+
| NULL                   |
+------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES