crypter

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RC4              = Algorithm("RC4")
	RSA              = Algorithm("RSA")
	AesGcm           = Algorithm("AES-GCM")
	AesOfb           = Algorithm("AES-OFB")
	AesCtr           = Algorithm("AES-CTR")
	AesCtrHmacSha256 = Algorithm("AES-CTR-HMAC-SHA256")
)

Variables

View Source
var (
	AlgorithmErr        = errors.New("unsupported algorithm")
	PassphraseErr       = errors.New("wrong passphrase")
	MACError            = errors.New("message authentication failed")
	UnknownVersionError = errors.New("unknown version")
)
View Source
var (
	V1 = &version1{
		iterations: 1000,
		hashAlg:    sha256.New,
		saltSize:   12,
		keySize:    32,
		nonceSize:  12,
	}
)

Functions

This section is empty.

Types

type Algorithm

type Algorithm string

type Version

type Version interface {
	Encrypt(plaintext, passphrase []byte, algorithm Algorithm) ([]byte, error)
	Decrypt(ciphertext, passphrase []byte, algorithm Algorithm) ([]byte, error)
	StreamEncrypt(src io.Reader, dst io.Writer, passphrase []byte, algorithm Algorithm) error
	StreamDecrypt(src io.Reader, dst io.Writer, passphrase []byte, algorithm Algorithm) error
	Sign(digest, privateKey []byte, algorithm Algorithm) ([]byte, error)
	Verify(signature, digest, publicKey []byte, algorithm Algorithm) (bool, error)
}

func LookupVersion

func LookupVersion(ver int32) (Version, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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