0

在 Django 中,我们保存一个散列密码密码,如

"gAAAAABgiwEaPluFLV48a1kZFLIQDJfvk5elLjRGBAwuLVwnkhzpOtxLTU4n6ble1pB0DNCYdDdcU1MaGL3uFAQvwILVJNx50w=="

还有一种盐

"-GcGi6r3TmMNz5cD8Cagpfli3Es-hz_s3hda5vr5G60="

在 Python 中,我使用Fernet 库解密密码,例如

f = Fernet(salt)
password = f.decrypt(bytes(password_cypher.encode())).decode()

问题是如何在php中像这种方法一样解密......?(Laravel & PHP)

4

1 回答 1

0

在php中我使用了库

kelvinmo/fernet-php

代码也很简单

$fernet = new \Fernet\Fernet(salt);
echo $fernet->decode(password_cypher)
于 2021-04-29T19:02:09.173 回答