Exploits for the MD5 and SHA-1 algorithms have become known. You
may wish to consider using another one-way encryption algorithm
instead, such as the SHA2()
function. See Section 14.13, “Encryption and Compression Functions”.
The legacy hashing component calclulates an MD5 and SHA-1 checksum for the string.
Purpose: Provides a migration path for users and applications so that you can move to a more secure hashing algorithm.
URN:
file://classic_hashing
For installation instructions, see Section 7.5.1, “Installing and Uninstalling Components”.
The component performs the following for the MD5 encryption algorithm:
Calculates an MD5 128-bit checksum for the string.
The value is returned as a string of 32 hexadecimal digits.
THe value returned is
NULLif the argument wasNULL.
The component performs the following for the SHA-1 encryption algorithm:
Calculates an SHA-1 160-bit checksum for the string, as described in RFC 3174 (Secure Hash Algorithm).
The value is returned as a string of 40 hexadecimal digits.
The value returned is
NULLif the argument isNULL.SHA(in string) returns a string the same as SHA1().
Keep in mind the following for the legacy hashing component:
The component only works on string arguments. Applications that needs to calculate checksums over other argument types need to add a
CAST.The component reads the FIPs mode at its initialization time. MD5 always returns
NULLif the FIPs mode is read to be on.If a generated column within any table table uses the
MD5 ()andSHA1functions that are removed as of MySQL 9.6.0, and MySQL server is upgraded to MySQL 9.6.0 or later, the table stops working. To resolve this, you must dispose of the generated column and have triggers on the table to generate the column value.