stream

package
v0.0.0-...-11d313d Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecryptOAEPRSA

func DecryptOAEPRSA(bMessage []byte, pk *rsa.PrivateKey) ([]byte, error)

func EncryptOAEPRSA

func EncryptOAEPRSA(bMessage []byte, p *rsa.PublicKey) ([]byte, error)

func GenerateAES256Key

func GenerateAES256Key() (key []byte, er error)

func GenerateAES256Keys

func GenerateAES256Keys(chainLength int) (keys [][]byte, er error)

func GenerateRSAKey

func GenerateRSAKey() (priv *rsa.PrivateKey, pub *rsa.PublicKey, er error)

func GenerateRSAKeys

func GenerateRSAKeys(chainLength int) (privs []*rsa.PrivateKey,
	pubs []*rsa.PublicKey, er error)

func UniqueIV

func UniqueIV(blockSize int) (iv []byte, er error)

func UniqueIVs

func UniqueIVs(chainLength, blockSize int) (ivs [][]byte, er error)

Types

type AES256KeysetBundle

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

type EncryptionLevel

type EncryptionLevel byte
const (
	None EncryptionLevel = iota
	RSA_OAEP
	AES_256_GCM
	AES_256_CFB
)

func (EncryptionLevel) Byte

func (e EncryptionLevel) Byte() (b byte)

type NestedAESCFB

type NestedAESCFB struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewNestedAESCFB

func NewNestedAESCFB(ivs,
	aesKeys [][]byte) (n *NestedAESCFB, er error)

func (*NestedAESCFB) AddLayers

func (n *NestedAESCFB) AddLayers(ivs, aesKeys [][]byte) (er error)

func (*NestedAESCFB) Decrypt

func (n *NestedAESCFB) Decrypt(chunk []byte, depth int) (pt []byte, er error)

not of use in the protocol. just to test Encrypt above

func (*NestedAESCFB) Depth

func (n *NestedAESCFB) Depth() (d int)

func (*NestedAESCFB) Encrypt

func (n *NestedAESCFB) Encrypt(chunk []byte,
	depth int) (ciph []byte, er error)

type NestedEncrypter

type NestedEncrypter interface {
	Encrypt(chunk []byte, depth int) (ciph []byte, er error)
}

type RSAKeysetBundle

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

Jump to

Keyboard shortcuts

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