ige

package
v0.0.0-...-761494b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataTooSmall     = errors.New("AES256IGE: data too small")
	ErrDataNotDivisible = errors.New("AES256IGE: data not divisible by block size")
)

Functions

func AlgoKey

func AlgoKey(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte

func BigExp

func BigExp(x, y, m *big.Int) *big.Int

func BytesToBig

func BytesToBig(b []byte) *big.Int

func BytesXor

func BytesXor(a, b []byte) []byte

func Decrypt

func Decrypt(msg, authKey, checkData []byte) ([]byte, error)

checkData это msgkey в понятиях мтпрото, нужно что бы проверить, успешно ли прошла расшифровка

func DecryptAES

func DecryptAES(data []byte, key string) ([]byte, error)

func DecryptMessageWithTempKeys

func DecryptMessageWithTempKeys(msg []byte, nonceSecond, nonceServer *big.Int) ([]byte, error)

DecryptMessageWithTempKeys дешифрует сообщение паролем, которые получены в процессе обмена ключами диффи хеллмана

func Encrypt

func Encrypt(msg, authKey []byte) (out, msgKey []byte, _ error)

func EncryptAES

func EncryptAES(data []byte, key string) ([]byte, error)

func EncryptMessageWithTempKeys

func EncryptMessageWithTempKeys(msg []byte, nonceSecond, nonceServer *big.Int) ([]byte, error)

EncryptMessageWithTempKeys шифрует сообщение паролем, которые получены в процессе обмена ключами диффи хеллмана

func MessageKey

func MessageKey(authKey, msgPadded []byte, decode bool) []byte

func Pad256

func Pad256(b []byte) []byte

func PasswordHash2

func PasswordHash2(password, salt1, salt2 []byte) []byte

func RandomBytes

func RandomBytes(size int) []byte

Types

type AesBlock

type AesBlock [aes.BlockSize]byte

type AesIgeBlock

type AesIgeBlock [48]byte

type AesKV

type AesKV [32]byte

type Cipher

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

func NewCipher

func NewCipher(key, iv []byte) (*Cipher, error)

NewCipher

type ModPow

type ModPow struct {
	Salt1 []byte
	Salt2 []byte
	G     int32
	P     []byte
}

type SrpAnswer

type SrpAnswer struct {
	GA []byte
	M1 []byte
}

func GetInputCheckPassword

func GetInputCheckPassword(password string, srpB []byte, mp *ModPow, random []byte) (*SrpAnswer, error)

Jump to

Keyboard shortcuts

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