Replacement for PHP password_verify function

Looking for native replacement for PHP password_verify function - it's wanted as the modern alternative to unsafe static password hash store in the database, for example.

Is something similar in rust?

Rust doesn't have this in the standard library. You'll need to role your own hashing strategy.

There's the crypto crate for most of your cryptographic needs.

1 Like

Thanks, just found similar API in rust-argon2
but not sure about this crate because the salt marked as deprecated option in PHP:

Warning

The salt option is deprecated. It is now preferred to simply use the salt that is generated by default. As of PHP 8.0.0, an explicitly given salt is ignored.

UPD password-hashes (by argon2 crate) looks good for my needs.