3 ms·
True, that's the tech behind it. Is there any reason most programmers should know any of this ? The code should look more like this(and should use a standard
by pinkyand 12y ago
True, that's the tech behind it.
Is there any reason most programmers should know any of this ?
The code should look more like this(and should use a standard library):
import Password_protector
P = Password_protector(date_of_first_use) #library upgrades algorithms every once in a while, only a single algorithm available per date. If there's a need for automatically upgraded hashing library should handle covertly.
protected_password = P.protect_password(password)
if P.compare_password(password, protected_password) == True ...
Or something similar. That at least should cover the basics - safely.
- mikeash 12y agoQuite simply, the reason programmers should know about this (if they're implementing a password system) is because the library you propose often doesn't exist, and when it does exist it's often implemented incorrectly. In an ideal world, programmers shouldn't have to worry about this stuff. But this is not an ideal world.
- sarciszewski 12y agoI suppose that's Python? The whitespace got chewed up by the comment system; please pastebin/gist it instead.