

#Authentication code app verification
If the attacker will get access to the secret, it's possible to generate the verification code and get around the security procedure. The secret is important and should be transferred over a secured channel. Generating a SecretĪ secret is used to provide a base for your application and the device generating the code to validate the user's identity.
#Authentication code app password
Let us take the current Unix Time Stamp: **UnixTimeStamp (time()/30): 44376117.366667**Īnd calculate the HOTP - onetime password based on HMAC ( ). The more secure your solution is, the less 30sec intervals you might want to check. The variance of the code is time (to be more precise, it's 30 sec intervals). Bearing in mind that not all devices use NTP to synchronize, we might want to check 3-5 sequential codes to be sure that the right code is entered. In other words, the encoded message is much easier to remember than base 64. The result can be included in a URL without encoding any characters.(For example, the symbol set omits the symbols for 1, 8, and zero, since they could be confused with the letters 'I', 'B', and 'O'.) The alphabet was selected to avoid similar-looking pairs of different symbols, so the strings can be accurately transcribed by hand.

The resulting character set contains one case (usually represented as uppercase), which can often be beneficial when using a case-insensitive filesystem, spoken speech, or human memory.Why is base32 and not base64 used? My guess takes into consideration the following points:

How is this combination generated? Let's move through the process:Īssume that the secret code in base32 is GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ (this is actually a base32 encoded secret key 12345678901234567890. Why? Because hackers would have to not only get your password and your username, they'd have to get your personal key used to generate the six-digit combination. Two-step verification drastically reduces the chances of having personal information in your Google account stolen by someone else. But nothing stops you from implementing an OTP generation algorithm in NodeJS (javaScript) or an Background I will use PHP in this article - this means that the server side can use this code to validate the client one. And even more - you can add a new level of security to your application very easily without the need to use some 3rd party monstrous security library. Do you know the nature of the code generated by Google Authenticator? There are no myths here - this is just an implementation of the RFC6238. Have you have enabled your Google account for two step authentication? If not -I strongly recommend to do so.

Github repository with demo code Introduction
