keyproof

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2015 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package keyproof implements a simple authentication system based on ed25519 signatures Alice sends a token to Bob that authenticates Alice to Bob and contains time information Bob then verifies and counter-signs the token and sends it back to Alice Alice verifies the original token, the counter-signature and the timing information and grants access or denies it

Index

Constants

View Source
const ProofTokenMax = 186

ProofTokenMax is the maximum size of a base58 encoded ProofToken

View Source
const ProofTokenSignedMax = 274

ProofTokenSignedMax is the maximum size of a base58 encoded signed prooftoken

View Source
const ProofTokenSignedSize = ProofTokenSize + ed25519.SignatureSize

ProofTokenSignedSize is the length of a counter-signed prooftoken

ProofTokenSize is the length of a proof token

View Source
const Version = "0.0.1 very alpha"

Version of this release

Variables

This section is empty.

Functions

func CounterSignToken

func CounterSignToken(proof *[ProofTokenSize]byte, recPubKey *[ed25519.PublicKeySize]byte, recPrivKey *[ed25519.PrivateKeySize]byte) (bool, *[ProofTokenSignedSize]byte)

CounterSignToken creates a counter-signature for token recPubKey is the public key of Bob. Returns true/false and the countersigned prooftoken

func SignProofToken

func SignProofToken(time int64, recPubkey, sendPubkey *[ed25519.PublicKeySize]byte, sendPrivKey *[ed25519.PrivateKeySize]byte) *[ProofTokenSize]byte

SignProofToken generates a signproof recPubkey is Bob's public key, sendPubkey and sendPrivkey are Alice's. time is the timestamp to embed returns the prooftoken

func VerifyCounterSig

func VerifyCounterSig(counterSig *[ProofTokenSignedSize]byte, sendPubkey *[ed25519.PublicKeySize]byte) (bool, int64)

VerifyCounterSig verifies that a counter signature is valid sendPubkey is the public key of Alice. Returns true/false and embedded timestamp

func VerifyProofToken

func VerifyProofToken(proof *[ProofTokenSize]byte, recPubkeyTest *[ed25519.PublicKeySize]byte) (bool, int64, *[ed25519.PublicKeySize]byte)

VerifyProofToken verifies a proof and returns the sender's public key recPubkeyTest is Bob's public key. Returns true/false, the embeded timestamp and Alice's pubkey

Types

This section is empty.

Jump to

Keyboard shortcuts

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