Crates.io docs.rs Crates.io

This crate provides a ready-to-use TOTP solution.

It supports some features not directly related to Totp:

These features require you to save the struct after every successful attempt. To make it easier, [serde::Serialize] and [serde::Deserialize] are derived on it.

Disable code reusing in real life

Don't forget to use exclusive lock in your DB (or whatever you persist the struct) to ensure the load-verify-save process is atomic, or attacker may reuse the code even if you disable code reusing.

License

eztotp is free software: you can redistribute it and/or modify it under one of following licenses:

eztotp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You should have received a copy of the GNU Lesser General Public License and Mozilla Public License along with eztotp. If not, see