Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
/ TOTP.jl Public archive

A pure julia implementation of the TOTP algorithm described in RFC 6238 and used by the Google Authenticator app.

License

Notifications You must be signed in to change notification settings

ylxdzsw/TOTP.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOTP.jl

Build Status Julia v1.0 ready

Installation

Pkg.clone("https://github.com/ylxdzsw/TOTP.jl")

Usage

using TOTP

# generate a random key (note this method use Julia's built-in random number generator, which is not crypto safe)
key = gensecret()

# share it to your user by a QR code
uri = genuri(key, "user@domain")
# make qr code of the uri

# generate an otp
genotp(key)

# generate 6 otps near now so you can match any one of them.
if user_input in genotp6(key)
    # authentication passed
end

About

A pure julia implementation of the TOTP algorithm described in RFC 6238 and used by the Google Authenticator app.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages