srp

package
v0.0.0-...-08da8a6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package srp implements the Secure Remote Password following SRP-6a protocol design.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SRPClient

type SRPClient struct {
	E []byte // email
	S []byte // salt

	A *big.Int // Public version of a

	K []byte // shared session key
	M []byte // The verification bytes used for prove client
	// contains filtered or unexported fields
}

SRPClient defines a SRP client

func NewSRPClient

func NewSRPClient(email, password string, primeBit int) (c *SRPClient, err error)

NewSRPClient creates a SRP client

func (*SRPClient) Calculate

func (c *SRPClient) Calculate(B *big.Int, salt []byte) (err error)

Calculate performs the SRP calculation

func (*SRPClient) CheckServer

func (c *SRPClient) CheckServer(proof []byte) (err error)

CheckServer checks whether the proof given by server is correct.

func (*SRPClient) GetVerifier

func (c *SRPClient) GetVerifier() (v *big.Int)

GetVerifier calculates the SRP Verifier

func (*SRPClient) GetX

func (c *SRPClient) GetX()

GetX calculates the SRP X

type SRPServer

type SRPServer struct {
	S []byte // salt

	B *big.Int // Public version of b

	K []byte // Commonly shared session key.
	M []byte // Key to verify client
	// contains filtered or unexported fields
}

SRPServer defines the SRP server

func NewSRPServer

func NewSRPServer(email, salt []byte, verifier *big.Int, A *big.Int, primeBit int) (s *SRPServer, err error)

NewSRPServer creates a new SRP server

func (*SRPServer) CheckClient

func (s *SRPServer) CheckClient(auth []byte) (proof []byte, err error)

CheckClient authenticates the client

Jump to

Keyboard shortcuts

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