dotp

package module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2016 License: MIT Imports: 9 Imported by: 0

README

Go dOTP

Build Status

Libary and CLI for working with dOTP

Install from compiled binary

Find the binaries at github.com/mdp/go-dotp/releases

Install from source

Just the library

go get github.com/mdp/go-dotp

The library and CLI

go get github.com/mdp/go-dotp/...

Usage

Two Factor SSH

Inside of sshd_config (usually at /etc/ssh/sshd_config)

Match Group twofactorusers
  ForceCommand /location/of/bin/dotp sshauth --id='myserver.com'

Users in the 'twofactorusers' group will now need to have their dOTP PublicID stored inside of $HOME/.dotp_id

When they login to SSH they will be presented with a QRCode Challenge which must be scanned with a dOTP mobile application to decrypt the One Time Password

Generate a challenge for a given Public ID

dotp challenge --pubid "E7jY95KejKzcXmhZct2Kvcz2QSap4vVTb89S6eKkBXuhK" --id="myserver.com" myotp123

Generate a KeyPair from a seed

Seed should always come from a random source.

dotp generate `cat /dev/random | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1`

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKeyPair

func DeriveKeyPair(input string) (pubKey, privateKey *[32]byte)

DeriveKeyPair takes a utf8 string, returns the [32]byte pub and secret keys

func GenerateKeyPair

func GenerateKeyPair() (pubKey, privateKey *[32]byte, err error)

GenerateKeyPair return a new randomly generated keypair

func GetPublicID

func GetPublicID(publicKey *[32]byte) string

GetPublicID create the public id from the pubkey

func GetPublicKeyFromPublicID

func GetPublicKeyFromPublicID(publicID string) (*[32]byte, error)

GetPublicKeyFromPublicID is what it is

Types

type Challenge

type Challenge struct {
	OTP     string
	Name    string
	Crypted sodiumbox.Message
}

Challenge - our Challenge containing the OTP

func CreateChallenge

func CreateChallenge(otp, name, recipientPubID string) (*Challenge, error)

CreateChallenge is what it is

func (*Challenge) Serialize

func (c *Challenge) Serialize() string

Serialize the challenge into a base32 uppercase string

func (*Challenge) Solve

func (c *Challenge) Solve(answer string) bool

Solve allows you to check if a answer matches the OTP

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL