Would a Python script like this be safe to use? There would be a file “theFile” on the disk:
myPassHash = theFile.read()
enteredPassword = raw_input("Enter your password: ")
enteredHash = hashlib.sha512(enteredPassword)
if myPassHash == enteredHash:
print "Correct!"
else:
print "Incorrect!"
This looks like it’s susceptible to a rainbow table attack, because you’re not salting the password.
For more information on salts (and why it’s a bad idea to roll your own authentication mechanism), read Eric Lippert’s fabulous series on password salting.