From f045b236a0d97232eba2efc1bec7e312f163da68 Mon Sep 17 00:00:00 2001 From: shubham390 <59197935+shubham390@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:19:28 +0530 Subject: [PATCH 1/4] Create Read me --- Read me | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Read me diff --git a/Read me b/Read me new file mode 100644 index 0000000..2b2803c --- /dev/null +++ b/Read me @@ -0,0 +1,26 @@ +#JavaOTP is a basic and an Open Source implementation of TOTP algorithm RFC6238 + +#TOTP Explantion and need of implementation** +#Explain- +{If your website features a username+password authentication system, you owe it +to your users to offer 2-factor authentication (or 2fa for short) as an additional +measure of protection for their accounts. If you're unfamiliar with 2fa, it's that +step in the login sequence that asks the user for a (typically) 6-digit numeric code +in order to complete user authentication. The 6 digit codes are either sent to the user's +phone as a text message upon a login attempt or generated by an app such as Google Authenticator. +Codes have a short validity period of typically 30 or 60 seconds. This will show you how +to implement such a system using java in a way that is compatible with Google Authenticator.} + + +#Implementation- +{Your first idea for implementing the server side component of a 2fa system might be to randomly +generate 6 digit codes with short validity periods and send them to the user's phone in response +to a login attempt. One major shortcoming with this approach is that your implementation wouldn't +be compatible with 2fa apps such as Google Authenticator which many users will prefer to use. +In order to build a 2fa system that is compatible with Google Authenticator, we need to know what +algorithm it uses to generate codes. Fortunately, there is an RCF which precisely specifies the algorithm. +RFC 6238 describes the "time-based one-time password" algorithm, or TOTP for short. The TOTP algorithm combines +a one time password (or secret key) and the current time to generate codes that change as time marches forward. +RFC 6238 also includes a reference implementation in java under the commercial-friendly Simplified BSD license. +This tutorial will show you how to use code from the RFC to build a working 2fa system that could easily be adapted +into your java project.} From 29fd5f580a0ffd2f0a6645aca316f0acfe9320fb Mon Sep 17 00:00:00 2001 From: shubham390 <59197935+shubham390@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:21:07 +0530 Subject: [PATCH 2/4] Create README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bcedb1 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# GoogleAuthenticator +Java program to use google API to generate TOTP (Time based OTP) using Google Authenticator available on playstore. Program generates secret key which can be used to authenticate the OTP received on the app. + + +#TOTP Explantion and need of implementation +#Explain- +{If your website features a username+password authentication system, you owe it +to your users to offer 2-factor authentication (or 2fa for short) as an additional +measure of protection for their accounts. If you're unfamiliar with 2fa, it's that +step in the login sequence that asks the user for a (typically) 6-digit numeric code +in order to complete user authentication. The 6 digit codes are either sent to the user's +phone as a text message upon a login attempt or generated by an app such as Google Authenticator. +Codes have a short validity period of typically 30 or 60 seconds. This will show you how +to implement such a system using java in a way that is compatible with Google Authenticator.} + + +#Implementation- +{Your first idea for implementing the server side component of a 2fa system might be to randomly +generate 6 digit codes with short validity periods and send them to the user's phone in response +to a login attempt. One major shortcoming with this approach is that your implementation wouldn't +be compatible with 2fa apps such as Google Authenticator which many users will prefer to use. +In order to build a 2fa system that is compatible with Google Authenticator, we need to know what +algorithm it uses to generate codes. Fortunately, there is an RCF which precisely specifies the algorithm. +RFC 6238 describes the "time-based one-time password" algorithm, or TOTP for short. The TOTP algorithm combines +a one time password (or secret key) and the current time to generate codes that change as time marches forward. +RFC 6238 also includes a reference implementation in java under the commercial-friendly Simplified BSD license. +This tutorial will show you how to use code from the RFC to build a working 2fa system that could easily be adapted +into your java project.} From ca3718457a4bc9aaad42f1c9e4b658b97b92a122 Mon Sep 17 00:00:00 2001 From: shubham390 <59197935+shubham390@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:21:39 +0530 Subject: [PATCH 3/4] Update Read me --- Read me | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/Read me b/Read me index 2b2803c..8b13789 100644 --- a/Read me +++ b/Read me @@ -1,26 +1 @@ -#JavaOTP is a basic and an Open Source implementation of TOTP algorithm RFC6238 -#TOTP Explantion and need of implementation** -#Explain- -{If your website features a username+password authentication system, you owe it -to your users to offer 2-factor authentication (or 2fa for short) as an additional -measure of protection for their accounts. If you're unfamiliar with 2fa, it's that -step in the login sequence that asks the user for a (typically) 6-digit numeric code -in order to complete user authentication. The 6 digit codes are either sent to the user's -phone as a text message upon a login attempt or generated by an app such as Google Authenticator. -Codes have a short validity period of typically 30 or 60 seconds. This will show you how -to implement such a system using java in a way that is compatible with Google Authenticator.} - - -#Implementation- -{Your first idea for implementing the server side component of a 2fa system might be to randomly -generate 6 digit codes with short validity periods and send them to the user's phone in response -to a login attempt. One major shortcoming with this approach is that your implementation wouldn't -be compatible with 2fa apps such as Google Authenticator which many users will prefer to use. -In order to build a 2fa system that is compatible with Google Authenticator, we need to know what -algorithm it uses to generate codes. Fortunately, there is an RCF which precisely specifies the algorithm. -RFC 6238 describes the "time-based one-time password" algorithm, or TOTP for short. The TOTP algorithm combines -a one time password (or secret key) and the current time to generate codes that change as time marches forward. -RFC 6238 also includes a reference implementation in java under the commercial-friendly Simplified BSD license. -This tutorial will show you how to use code from the RFC to build a working 2fa system that could easily be adapted -into your java project.} From 53d17d2a194a88da873ef5ae5bcd50efcbd538fc Mon Sep 17 00:00:00 2001 From: shubham390 <59197935+shubham390@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:23:02 +0530 Subject: [PATCH 4/4] Delete Read me --- Read me | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Read me diff --git a/Read me b/Read me deleted file mode 100644 index 8b13789..0000000 --- a/Read me +++ /dev/null @@ -1 +0,0 @@ -