crypto

package
v0.0.0-...-2536ce9 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const FOLD int = 16
View Source
const KEYP int = 13
View Source
const N int = 16

Variables

View Source
var AUDIO_AESIV = []byte{0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8, 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93}

Functions

func CreateCipher

func CreateCipher(key []byte) cipher.Block

func CreateStream

CreateStream initializes a new Shannon-encrypted PacketStream connection from the specified keys and plain connection

func GenerateKeysFromPrivate

func GenerateKeysFromPrivate(private *big.Int, nonce []byte) *rsaKeys

func Powm

func Powm(base, exp, modulus *big.Int) *big.Int

func RandomVec

func RandomVec(count int) []byte

Types

type BlockDecrypter

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

func (*BlockDecrypter) DecryptSegment

func (afd *BlockDecrypter) DecryptSegment(byteOfs int64, block cipher.Block, ciphertext []byte, plaintext []byte)

type Keys

type Keys interface {
	PubKey() []byte
	PrivateKey() *big.Int

	Prime() *big.Int

	ClientNonce() []byte

	SharedKey(publicKey string) []byte

	AddRemoteKey(remote []byte, clientPacket []byte, serverPacket []byte) SharedKeys
}

func GenerateKeys

func GenerateKeys() Keys

type SharedKeys

type SharedKeys struct {
	Challenge []byte
	SendKey   []byte
	RecvKey   []byte
}

Jump to

Keyboard shortcuts

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