Encryption and Compression Functions Block Encryption Mode Initialization Vector Required OFB Yes Statements that use  AES_ENCRYPT()  or  AES_DECRYPT()  are unsafe for statement-based replication. If  AES_ENCRYPT()  is invoked from within the  mysql  client, binary strings display using hexadecimal notation, depending on the value of the  --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . Compresses a string and returns the result as a binary string. This function requires MySQL to have been compiled with a compression library such as  zlib . Otherwise, the return value is always  NULL . The compressed string can be uncompressed with  UNCOMPRESS() . The compressed string contents are stored the following way: If  COMPRESS()  is invoked from within the  mysql  client, binary strings display using hexadecimal notation, depending on the value of the  --binary-as-hex . For more information about that option, see Section 4.5.1, “mysql — The MySQL Command-Line Client” . Calculates an MD5 128-bit checksum for the string. The value is returned as a string of 32 hexadecimal digits, or  NULL  if the argument was  NULL . The return value can, for example, be used as a hash key. See the notes at the beginning of this section about storing hash values efficiently. The return value is a string in the connection character set. If FIPS mode is enabled,  MD5()  returns  NULL . See Section 6.8, “FIPS Support” . This is the “RSA Data Security, Inc. MD5 Message-Digest Algorithm.” See the note regarding the MD5 algorithm at the beginning this section. 2274 mysql>  SELECT MD5(’testing’); -> ’ae2b1fca515949e5d54fb22b8ed95575’ mysql>  SELECT LENGTH(COMPRESS(REPEAT(’a’,1000))); -> 21 mysql>  SELECT LENGTH(COMPRESS(’’)); -> 0 mysql>  SELECT LENGTH(COMPRESS(’a’)); -> 13 mysql>  SELECT LENGTH(COMPRESS(REPEAT(’a’,16))); -> 15 •Empty strings are stored as empty strings. •Nonempty strings are stored as a 4-byte length of the uncompressed string (low byte first), followed by the compressed string. If the string ends with space, an extra  .  character is added to avoid problems with endspace trimming should the result be stored in a  CHAR  or  VARCHAR  column. (However, use of nonbinary string data types such as  CHAR  or  VARCHAR  to store compressed strings is not recommended anyway because character set conversion may occur. Use a  VARBINARY  or  BLOB binary string column instead.) • MD5( str ) • COMPRESS( string_to_compress )