# Encryption, Hashing and Compression Functions

- [AES\_DECRYPT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/aes_decrypt.md): Decrypt data using AES. This function decrypts a string that was encrypted using the Advanced Encryption Standard (AES) algorithm.
- [AES\_ENCRYPT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/aes_encrypt.md): Encrypt data using AES. This function encrypts a string using the Advanced Encryption Standard (AES) algorithm and returns a binary string.
- [COMPRESS](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/compress.md): Compress a string. This function compresses a string argument and returns the result as a binary string, useful for saving storage space.
- [DECODE](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/decode.md): Decrypt a string. This function decrypts an encrypted string using a password. It is the reverse of the ENCODE function.
- [DES\_DECRYPT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/des_decrypt.md): Decrypt data using DES. This function decrypts a string that was encrypted using the Data Encryption Standard (DES) algorithm.
- [DES\_ENCRYPT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/des_encrypt.md): Encrypt data using DES. This function encrypts a string using the Data Encryption Standard (DES) algorithm.
- [ENCODE](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/encode.md): Encrypt a string. This function encrypts a string using a password, returning a binary string. It is the reverse of the DECODE function.
- [ENCRYPT](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/encrypt.md): Encrypt a string using Unix crypt(). This function encrypts a string using the Unix crypt() system call, typically used for password hashing.
- [KDF](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/kdf.md): Derive a key. This function derives a key from a password using a Key Derivation Function (KDF), enhancing security for password storage.
- [MD5](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/md5.md): Calculate MD5 checksum. This function returns the MD5 hash of a string as a 32-character hexadecimal number.
- [OLD\_PASSWORD](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/old_password.md): Generate pre-4.1 password hash. This function creates a password hash compatible with the hashing method used in MySQL versions prior to 4.1.
- [PASSWORD](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/password.md): Calculate password hash. This function calculates a password hash string for a plaintext password.
- [RANDOM\_BYTES](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/random_bytes.md): Generate random bytes. This function returns a binary string of random bytes of a specified length, suitable for cryptographic use.
- [SHA1](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/sha1.md): Calculate SHA-1 checksum. This function computes the SHA-1 160-bit checksum for a string, returning a 40-character hexadecimal string.
- [SHA2](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/sha2.md): Calculate SHA-2 checksum. This function computes the SHA-2 family of hash functions (SHA-224, SHA-256, SHA-384, and SHA-512).
- [UNCOMPRESS](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/uncompress.md): Uncompress a compressed string. This function uncompresses a binary string compressed by the COMPRESS function.
- [UNCOMPRESSED\_LENGTH](https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/encryption-hashing-and-compression-functions/uncompressed_length.md): Return length of uncompressed string. This function returns the length of a compressed string before it was compressed.


---

# 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.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.
