encrypt

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PEM_ENCRYPTION_KEY = "ENCRYPTION KEY"
	PEM_ENCRYPTED_DATA = "ENCRYPTED DATA"
)
View Source
const (
	AES_128 = algorithm(16)
	AES_192 = algorithm(24)
	AES_256 = algorithm(32)
)
View Source
const (
	ALGO_AES_128 = "AES-128"
	ALGO_AES_192 = "AES-192"
	ALGO_AES_256 = "AES-256"
)
View Source
const ALGO = "algorithm"

Variables

This section is empty.

Functions

func AlgoForKey

func AlgoForKey(key []byte) (algorithm, error)

func Decrypt

func Decrypt(key []byte, cipherText []byte) ([]byte, error)

func Encrypt

func Encrypt(key []byte, data []byte) ([]byte, error)

func EncryptedToPem

func EncryptedToPem(algo algorithm, data []byte) []byte

func GetEncyptedData

func GetEncyptedData(data []byte) ([]byte, algorithm)

func KeyFromAny

func KeyFromAny(k interface{}) ([]byte, error)

func KeyFromPem

func KeyFromPem(data []byte) ([]byte, error)

func KeyToPem

func KeyToPem(data []byte) []byte

func NewKey

func NewKey(t algorithm) ([]byte, error)

func OptionalDecrypt

func OptionalDecrypt(key []byte, data []byte) ([]byte, error)

func ReadKey

func ReadKey(path string, fss ...vfs.FileSystem) ([]byte, error)

func WriteKey

func WriteKey(key []byte, path string, fss ...vfs.FileSystem) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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