encrypt

package
v0.0.0-...-7f57e1f Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(ciphertext []byte) ([]byte, error)

Decrypt decrypts ciphertext to plaintext.

func Encrypt

func Encrypt(plaintext []byte) ([]byte, error)

Encrypt encrypts plaintext to ciphertext.

func InitCipher

func InitCipher(key []byte)

InitCipher initializes the defaultCipher.

func IsInitialized

func IsInitialized() bool

IsInitialized returns whether the defaultCipher is initialized or not.

Types

type Cipher

type Cipher interface {
	Encrypt(plaintext []byte) ([]byte, error)
	Decrypt(ciphertext []byte) ([]byte, error)
}

Cipher is the interface for encrypt/decrypt.

Jump to

Keyboard shortcuts

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