Argon2 hash to use for disabled accounts

105 views Asked by At

For the Python argon2 library, I would like a simple hash value that is not the hash of any actual password, and yet will raise argon2.exceptions.VerifyMismatchError rather than another exception when checked. I am looking for a way to disable accounts by changing the hash value only, and it would be very helpful if it the 'disabled' hash was visually distinct from normal hashes.

On many Linux systems, a single exclamation mark (!) serves this purpose in /etc/shadow.

Stated another way, what can I use for valid_but_impossible_hash below so that this code displays password is invalid?

import argon2

ph = argon2.PasswordHasher()
try:
    ph.verify('valid_but_impossible_hash', 'Tr0ub4dor&3')
except argon2.exceptions.VerifyMismatchError:
    print("password is invalid")

I was unable to find a such a hash value in the Argon2 documentation or elsewhere on the web.

0

There are 0 answers