encryption

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncryptedMessage

type EncryptedMessage struct {
	EncryptedKey    string
	EncryptedData   []byte
	MessageChecksum string
	OverallChecksum string
}

type EncryptionScheme

type EncryptionScheme interface {
	Initialize(mnemonic string) error
	InitForEncryption(tag string)
	InitForDecryption(tag string, encryptedKey string) error
	Encrypt(data []byte) (*EncryptedMessage, error)
	Decrypt(*EncryptedMessage) ([]byte, error)
	GetEncryptedKey() string
}

func NewEncryptionScheme

func NewEncryptionScheme() EncryptionScheme

type PREEncryptedMessage

type PREEncryptedMessage struct {
	EncryptedKey    kyber.Point `json:"-"`
	EncryptedData   []byte
	MessageChecksum []byte
	OverallChecksum []byte
	TagA            []byte
}

func (*PREEncryptedMessage) MarshalJSON

func (u *PREEncryptedMessage) MarshalJSON() ([]byte, error)

type PREEncryptionScheme

type PREEncryptionScheme struct {
	PublicKey    kyber.Point
	PrivateKey   kyber.Scalar
	SuiteObj     Suite
	Tag          []byte
	T            kyber.Point
	Ht           kyber.Point
	EncryptedKey kyber.Point
}

func (*PREEncryptionScheme) Decrypt

func (pre *PREEncryptionScheme) Decrypt(encMsg *EncryptedMessage) ([]byte, error)

func (*PREEncryptionScheme) Encrypt

func (pre *PREEncryptionScheme) Encrypt(data []byte) (*EncryptedMessage, error)

func (*PREEncryptionScheme) GetEncryptedKey

func (pre *PREEncryptionScheme) GetEncryptedKey() string

func (*PREEncryptionScheme) InitForDecryption

func (pre *PREEncryptionScheme) InitForDecryption(tag string, encryptedKey string) error

func (*PREEncryptionScheme) InitForEncryption

func (pre *PREEncryptionScheme) InitForEncryption(tag string)

func (*PREEncryptionScheme) Initialize

func (pre *PREEncryptionScheme) Initialize(mnemonic string) error

func (*PREEncryptionScheme) SymDec

func (pre *PREEncryptionScheme) SymDec(group kyber.Group, ctx []byte, keyhash []byte) ([]byte, error)

---------------------------------Symmetric Decryption using AES with GCM mode---------------------------------

func (*PREEncryptionScheme) SymEnc

func (pre *PREEncryptionScheme) SymEnc(group kyber.Group, message []byte, keyhash []byte) ([]byte, error)

---------------------------------Symmetric Encryption using AES with GCM mode---------------------------------

type Suite

type Suite interface {
	kyber.Group
	kyber.Random
}

Suite represents the set of functionalities needed by the package schnorr.

Jump to

Keyboard shortcuts

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