June 2010
Intermediate to advanced
328 pages
7h 51m
English
The chief problem in this antipattern is that the original form of the password is readable. But you can authenticate the user’s input against a password without reading it. This section describes how to implement this kind of secure password storage in an SQL database.
Encode the password using a one-way cryptographic hash function. This transforms its input string into a new string, called the hash, that is unrecognizable. Even the length of the original string is obscured, because the hash returned by a hash function is a fixed-length string. For example, the SHA-256 algorithm converts our example password, xyzzy, to a 256-bit string of bits, usually represented as ...
Read now
Unlock full access