Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 925 Bytes

README.md

File metadata and controls

13 lines (9 loc) · 925 Bytes

2FA - CPP

This is a repository for a very bare-bones 2fa (2 factor authenticator) integration made in C++. The original version of the code is made by Arne Gockeln, this one is a version made for straight and easy integration and use.

Use

With all the required files, in you main operational file, you have to include the Auth.h file. A token is generated by the generateToken() function which is called as auth::generateToken() requires the 2fa secret to generate the token and the optional, not suggested to edit, timeout interval.

You can test the program by adding the exact same hash secret on pretty much any 2fa apps on your phone.

Compile

The code is based on a modified version of libcppotp (COPT) library and it is required for the code to run successfully.

If you are not sure how to use the code, check the example.cpp file.