This project is a simple command-line tool created as a school project using Rust. ๐ It's designed to generate Time-based One-Time Passwords (TOTP) by encrypting a key and generating a QR code for TOTP app registration. ๐
- Encrypt Key: ๐ Securely encrypts a provided hex key and saves it for TOTP generation.
- Generate QR Code: ๐ฑ Creates a QR code to easily add the encrypted key to a TOTP app.
- Generate TOTP: ๐๏ธ Produces a TOTP code using the encrypted key and current time.
- Rust Programming Language ๐ฆ
To set up this project, follow these steps:
git clone <repository-url>
cd ft_otp
cargo build --release
Execute the program with options to encrypt a key, generate a QR code, or produce a TOTP code:
./target/release/ft_otp [OPTIONS]
-g, --generate <path>
: ๐ Encrypt and save a hex key from a specified path.-q, --qrcode <file>
: ๐ผ๏ธ Specify the output file for the QR code (defaultqr.png
).-k, --key <path>
: ๐๏ธ Use an encrypted key file to generate the TOTP code (defaultft_otp.key
).
- To encrypt a key and generate a QR code:
./target/release/ft_otp --generate your_key_path --qrcode your_qr_code.png
- To generate a TOTP code:
./target/release/ft_otp --key your_encrypted_key_file