Open zx80 opened 1 month ago
Just had this same issue. If you set encoding=None
in the call to decrypt
then it works fine (although perhaps not always the most ideal!).
import os
import scrypt # 0.8.24
data = scrypt.encrypt(os.urandom(64), "secret", maxtime=0.1)
scrypt.decrypt(data, "secret", maxtime=0.1, encoding=None) # throws no error
Regardless, the example should be updated to work properly!
The example about password hashing based on using the password as a key to encode a random string does not work at all:
results in
The library seems to assume that the encoded stuff is unicode, which is very unlikely when considering random bytes.
Note that sometime it also fails on
maxtime
.Consider adding to tests the examples shown in the documentation?