cipher

package
v0.0.0-...-fd8181f Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCipher

func GetCipher(method, password string) (sc StreamCipher, ac AEADCipher, err error)

func Kdf

func Kdf(password string, keyLen int) []byte

#include <openssl/evp.h> int EVP_BytesToKey(

const EVP_CIPHER *type,
const EVP_MD *md,
const unsigned char *salt,
const unsigned char *data,
int datal,
int count,
unsigned char *key,
unsigned char *iv);

Types

type AEADCipher

type AEADCipher interface {
	KeySize() int
	SaltSize() int
	Encrypter([]byte) (cipher.AEAD, error)
	Decrypter([]byte) (cipher.AEAD, error)
}

func AESGCM

func AESGCM(key []byte, saltSize int) (AEADCipher, error)

func CHACHA20POLY1305

func CHACHA20POLY1305(key []byte, saltSize int) (AEADCipher, error)

func NewAEADipher

func NewAEADipher(method, password string) (AEADCipher, error)

func XCHACHA20POLY1305

func XCHACHA20POLY1305(key []byte, saltSize int) (AEADCipher, error)

type StreamCipher

type StreamCipher interface {
	KeySize() int
	IVSize() int
	Key() []byte
	Encrypter([]byte) (cipher.Stream, error)
	Decrypter([]byte) (cipher.Stream, error)
}

func AESCFB

func AESCFB(key []byte, ivSize int) (StreamCipher, error)

func AESCTR

func AESCTR(key []byte, ivSize int) (StreamCipher, error)

func BFCFB

func BFCFB(key []byte, ivSize int) (StreamCipher, error)

func CHACHA20

func CHACHA20(key []byte, ivSize int) (StreamCipher, error)

func CHACHA20IETF

func CHACHA20IETF(key []byte, ivSize int) (StreamCipher, error)

func NewStreamCipher

func NewStreamCipher(method, password string) (StreamCipher, error)

func RC4MD5

func RC4MD5(key []byte, ivSize int) (StreamCipher, error)

func SALSA20

func SALSA20(key []byte, ivSize int) (StreamCipher, error)

Jump to

Keyboard shortcuts

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