...
Wiki Markup |
---|
While using a password, consider storing its hash instead of plaintext. Use the hash for comparisons and other purposes. The following code \[[Viega 2001|AA. Bibliography#Viega 01]\] illustrates this: |
Code Block | ||||
---|---|---|---|---|
| ||||
int validate(char *username) { char *password; char *checksum; password = read_password(); checksum = compute_checksum(password); erase(password); /* securely erase password */ return !strcmp(checksum, get_stored_checksum(username)); } |
...