srp

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package srp contains implementation of Secure Remote Password protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	// A parameter (see SRP)
	A []byte
	// M1 parameter (see SRP)
	M1 []byte
}

Answer is result of SRP algorithm.

type Input

type Input struct {
	// One of two salts used by the derivation function (see SRP 2FA login)
	Salt1 []byte
	// One of two salts used by the derivation function (see SRP 2FA login)
	Salt2 []byte
	// Base (see SRP 2FA login)
	G int
	// 2048-bit modulus (see SRP 2FA login)
	P []byte
}

Input is hashing algorithm parameters from server.

Copy of tg.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow

type SRP

type SRP struct {
	// contains filtered or unexported fields
}

SRP is client implementation of Secure Remote Password protocol.

See https://core.telegram.org/api/srp.

func NewSRP

func NewSRP(random io.Reader) SRP

NewSRP creates new SRP instance.

func (SRP) Hash

func (s SRP) Hash(password, srpB, random []byte, i Input) (Answer, error)

Hash computes user password hash using parameters from server. Parameters

See https://core.telegram.org/api/srp#checking-the-password-with-srp.

Jump to

Keyboard shortcuts

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