crypto

package
v0.0.0-...-d95dd9a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Challenge

func Challenge(pwd string, ctx *engine.AccountInfo) (
	[]byte, []byte, error)

Challenge takes the master password `pwd`, the account information `ctx` (including username and url) and returns a blinding factor and a challenge.

func Finish

func Finish(bfac []byte, resp []byte) ([]byte, error)

Finish takes the blinding factor generated from `Challenge` and the response from `Response` and output a pseudo-random string.

func GenerateKey

func GenerateKey() ([]byte, error)

GenerateKey generates a new random device key.

func GenerateSalt

func GenerateSalt() ([]byte, error)

GenerateSalt returns a new random salt.

func NewDeviceForAccount

func NewDeviceForAccount(key []byte, salt []byte) (*deviceForAccount, error)

NewDeviceForAccount converts the key material and salt of an account to a proper cryptograhic format.

func Response

func Response(dev *deviceForAccount, chal []byte) ([]byte, error)

Response takes the device's key (and salt) `dev`, the challenge `chal` from the client, and returns a response.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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