stupid-2fa

Crates.iostupid-2fa
lib.rsstupid-2fa
version0.1.0
sourcesrc
created_at2024-07-19 20:55:49.302935
updated_at2024-07-19 20:55:49.302935
descriptionA simple way to authenticate client app without cloud
homepage
repository
max_upload_size
id1309065
size8,425
Natan Gabriel Almeida de castro (NatanCastro)

documentation

README

Stupid 2FA

A simple way to authenticate client app without cloud

use

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);
}

Functionalities

  • HMAC-based auth

Reference

some articles on the topic of authentication

License

MIT

contributing

Contributions are always welcome! any suggestions, open a pull request or a issue.

code of conduct: format your code, thx.

Commit count: 0

cargo fmt