andotp-import

Crates.ioandotp-import
lib.rsandotp-import
version0.1.2
sourcesrc
created_at2023-10-02 20:05:56.260541
updated_at2023-10-12 13:04:56.527767
descriptionandOTP backup reader
homepage
repositoryhttps://github.com/FliegendeWurst/andotp-import/
max_upload_size
id990437
size18,757
Arne Keller (FliegendeWurst)

documentation

README

andotp-import

This is a simple crate to read encrypted backups created by the andOTP Android app.

Usage

Create an encrypted backup in the app and copy it to where you need it. The code below will prompt for a password, open the backup file and print all current TOTP codes.

fn main() {
	let pw = rpassword::prompt_password("password: ").unwrap();
	let accts = andotp_import::read_from_file("./otp_accounts_2023-10-02_18-58-25.json.aes", &pw).unwrap();

	for (acct, totp) in accts {
		println!("{} {}", acct.label, totp.generate_current().unwrap());
	}
}

The full API documentation is available at docs.rs.

License

MIT License, see LICENSE

Commit count: 6

cargo fmt