Many encryption and compression functions return strings for which the result might contain arbitrary byte values. If you want to store these results, use a column with a Some encryption functions return strings of ASCII characters: If an application stores values from a function such as The size penalty for storing the hex string in a
Suppose that an application stores
To convert hex strings to more compact form, modify the application to use
Applications should be prepared to handle the very rare case that a hashing function produces the same value for two different input values. One way to make collisions detectable is to make the hash column a primary key. Note Exploits for the MD5 and SHA-1 algorithms have become known. You may
wish to consider using another one-way encryption function described in this section instead, such as Caution Passwords or other sensitive values supplied as arguments to encryption functions are sent as cleartext to the MySQL server unless an SSL connection is used. Also, such values appear in any MySQL logs to which they are written. To avoid these types of exposure, applications can encrypt sensitive values on the client side before sending them to the server. The same considerations apply to encryption keys. To avoid exposing these, applications can use stored procedures to encrypt and decrypt values on the server side.
|