oracle

package
v0.0.0-...-c011c5d Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECB = iota
	CBC
)

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey() ([]byte, error)

Types

type AdvancedECBOracle

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

func (*AdvancedECBOracle) Encrypt

func (o *AdvancedECBOracle) Encrypt(userInput []byte) ([]byte, error)

type CommentEncrypter

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

func NewCommentEncrypter

func NewCommentEncrypter() *CommentEncrypter

func (*CommentEncrypter) CheckIsAdmin

func (ce *CommentEncrypter) CheckIsAdmin(input []byte) (bool, error)

func (*CommentEncrypter) Encrypt

func (ce *CommentEncrypter) Encrypt(input []byte) ([]byte, error)

type ECBOracle

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

func (*ECBOracle) Encrypt

func (o *ECBOracle) Encrypt(userInput []byte) ([]byte, error)

type Encrypter

type Encrypter interface {
	Encrypt([]byte) ([]byte, error)
}

func NewAdvancedECBOracle

func NewAdvancedECBOracle(secret []byte) Encrypter

func NewECBOracle

func NewECBOracle(secretStuff []byte) Encrypter

type Random

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

func NewRandom

func NewRandom() *Random

func (*Random) Encrypt

func (o *Random) Encrypt(plainText []byte) ([]byte, int, error)

RandomEncrypt will generate a random key, prepend and append random bytes to the text, and encrypt under either ecb or cbc

Jump to

Keyboard shortcuts

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