> For the complete documentation index, see [llms.txt](https://mariadb.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/des_decrypt.md).

# DES\_DECRYPT

{% hint style="warning" %}
`DES_DECRYPT` was **removed in MariaDB 13.0**, together with the `--des-key-file` option and the `FLUSH DES_KEY_FILE` statement. It was deprecated in earlier releases. Use [AES\_DECRYPT()](/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/aes_decrypt.md) instead. The description below applies to MariaDB releases before 13.0.
{% endhint %}

## Syntax

```bnf
DES_DECRYPT(crypt_str[,key_str])
```

## Description

Decrypts a string encrypted with [DES\_ENCRYPT()](/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/des_encrypt.md). If an error occurs, this function returns `NULL`.

This function works only if MariaDB has been configured with [TLS support](/docs/server/security/encryption/data-in-transit-encryption/secure-connections-overview.md).

If no `key_str` argument is given, `DES_DECRYPT()` examines the first byte of the encrypted string to determine the DES key number that was used to encrypt the original string, and then reads the key from the DES key file to decrypt the message. For this to work, the user must have the SUPER privilege. The key file can be specified with the`--des-key-file` server option.

If you pass this function a <kbd>key\_str</kbd> argument, that string is used as the key for decrypting the message.

If the <kbd>crypt\_str</kbd> argument does not appear to be an encrypted string, MariaDB returns the given <kbd>crypt\_str</kbd>.

<sub>*This page is licensed: GPLv2, originally from*</sub> [<sub>*fill\_help\_tables.sql*</sub>](https://github.com/MariaDB/server/blob/main/scripts/fill_help_tables.sql)

{% @marketo/form formId="4316" %}
