| Crates.io | stupid-2fa |
| lib.rs | stupid-2fa |
| version | 0.1.0 |
| created_at | 2024-07-19 20:55:49.302935+00 |
| updated_at | 2024-07-19 20:55:49.302935+00 |
| description | A simple way to authenticate client app without cloud |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1309065 |
| size | 8,425 |
A simple way to authenticate client app without cloud
This project use the env variable STUPID_2FA_PRIVATE_KEY as the private key
An simple example of it working
fn main() {
let lock_code = generate_lock_code();
println!("Lock Code: {}", lock_code);
let subscription_days = 30;
let unlock_code = generate_unlock_code(&lock_code, subscription_days);
println!("Unlock Code: {}", unlock_code);
let is_valid = validate_unlock_code(&lock_code, &unlock_code, subscription_days);
println!("Is Unlock Code Valid? {}", is_valid);
}
HMAC-based auth
some articles on the topic of authentication
Contributions are always welcome! any suggestions, open a pull request or a issue.
code of conduct: format your code, thx.