8000 GitHub - andrewromanenco/g2fa: Temp password generation for 2 factor authentication.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andrewromanenco/g2fa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

g2pa

Temporary password generation for two-factor authentication. Works with Google Authenticator mobile app.

Sample usage

  1. Get Google Authenticator
  2. Tap on 'Set up account'
  3. Pick 'Enter provided code'
  4. Enter account name 'GoLang console'
  5. Enter key 'PT2KHGTK7YQ3EVIK'
  6. Save
  7. Run code from below in the console. Temporary password from the console and from the app will match
package main

import (
    "fmt"
    "github.com/andrewromanenco/g2fa"
)

func main() {
    //key, err := g2fa.GenerateKey()
    //skey := g2fa.EncodeKey(key)
    skey := "PT2KHGTK7YQ3EVIK"
    key, err := g2fa.DecodeKey(skey)
    
    if err != nil {
        panic(err)
    }
    code, err := g2fa.GetTimedAuthCode(key)
    if err != nil {
        panic(err)
    }
    fmt.Println("Key: ", skey)
    fmt.Println("Temp code: ", code)
}

About

Temp password generation for 2 factor authentication.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0