h2cipher

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CipherID = "aes"
)

Variables

This section is empty.

Functions

func Register

func Register(algs h2cipher.Algs)

Register registers a cipher alg

Types

type Cipher

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

Cipher implements h2cipher.Cipher for aes

func New

func New(config Config) (*Cipher, error)

New creates a new aes cipher

func NewFromParams

func NewFromParams(params string) (*Cipher, error)

NewFromParams creates an aes cipher from params

func (*Cipher) Decrypt

func (c *Cipher) Decrypt(ciphertext string) ([]byte, error)

func (*Cipher) Encrypt

func (c *Cipher) Encrypt(plaintext []byte) (string, error)

Encrypt encrypts using aes

Security paramter is 2^32 random nonce uses.

func (*Cipher) ID

func (c *Cipher) ID() string

type Config

type Config struct {
	Key []byte
}

Config are aes params

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates a new aes config

func ParseConfig

func ParseConfig(params string) (*Config, error)

ParseConfig loads an aes config from params string

func (Config) String

func (c Config) String() string

Jump to

Keyboard shortcuts

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