I have a long password I want to encode. I use the bcrypt main tutorial:
>>> password = b"an incredibly long password" * 10
>>> hashed = bcrypt.hashpw(
... base64.b64encode(hashlib.sha256(password).digest()),
... bcrypt.gensalt()
... )
However, when I check using the tutorial as follows, it does not match:
input_password = "..." # some password
bcrypt.checkpw(input_password.encode("utf8"), hashed)
I think I have to decode it as well. Should base64.b64encode(hashlib.sha256(input_password).digest()
work?