# DES\_DECRYPT

{% hint style="warning" %}
`DES_DECRYPT` is deprecated and will be removed in a future release.
{% endhint %}

## Syntax

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

## Description

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

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

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" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/des_decrypt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
