Bug #75303 Option in hash functions for binary output
| Submitted: | 24 Dec 2014 3:04 | Modified: | 19 Nov 2015 17:52 |
|---|---|---|---|
| Reporter: | Trey Raymond | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Security: Encryption | Severity: | S4 (Feature request) |
| Version: | OS: | Any | |
| Assigned to: | CPU Architecture: | Any |
[19 Nov 2015 17:52]
Georgi Kodinov
thank you for the reasonable feature request.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: MySQL is missing an argument in its hash functions to specify binary vs hex output. This is odd, as inside the database, most hashes would be stored in binary. If you have a field "value_md5 binary(16)" and the client doesn't handle the processing on its side, writes end up looking like "insert into table set value_md5=unhex(md5('value'));" The overhead of that function is low, but it's adding extra steps for the server to generate the hash, hex-encode it, then decode again to binary - and that could be very simply avoided. Seems like most database-internal uses of a hash function want binary rather than hex, so this would cover the majority of use cases. How to repeat: call a hash function, see http://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html Suggested fix: add an optional second parameter to hash functions that could be 0/1 (or whatever) for binary output. default to hex-encoded for backwards compatibility.