crypto

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 10 Imported by: 0 modules, 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

This section is empty.

Variables

This section is empty.

Functions

func AESCBCDecrypt

func AESCBCDecrypt(key, iv, ciphertext []byte) ([]byte, error)

func AESCBCEncrypt

func AESCBCEncrypt(key, iv, plaintext []byte) ([]byte, error)

func AESGCMDecrypt

func AESGCMDecrypt(key, nonce, ciphertext []byte) ([]byte, error)

func AESGCMDecryptBlob

func AESGCMDecryptBlob(key, blob, aad []byte) ([]byte, error)

AESGCMDecryptBlob takes [12-byte nonce][ciphertext + 16-byte tag], as Yandex stores it.

func AESGCMEncrypt

func AESGCMEncrypt(key, nonce, plaintext []byte) ([]byte, error)

func DES3Decrypt

func DES3Decrypt(key, iv, ciphertext []byte) ([]byte, error)

func DES3Encrypt

func DES3Encrypt(key, iv, plaintext []byte) ([]byte, error)

func PBKDF2Key

func PBKDF2Key(password, salt []byte, iterations, keyLen int, newHash func() hash.Hash) []byte

PBKDF2Key is adapted from golang.org/x/crypto/pbkdf2.

Types

type ASN1PBE

type ASN1PBE interface {
	Decrypt(key []byte) ([]byte, error)
	Encrypt(key, plaintext []byte) ([]byte, error)
}

ASN1PBE keys privateKeyPBE and passwordCheckPBE with the global salt, and credentialPBE with the master key.

func NewASN1PBE

func NewASN1PBE(encoded []byte) (pbe ASN1PBE, err error)

Jump to

Keyboard shortcuts

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