...
Wiki Markup |
---|
See [MEM06-C. Ensure that sensitive data is not written out to disk|MEM06-C. Ensure that sensitive data is not written out to disk].
While using a password, consider storing its hash instead of plaintext. Use the hash for comparisons and other purposes. The following code \[[Viega 01|AA. C References#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));
}
|
...
49. Miscellaneous (MSC) Image Modified