crypto

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2016 License: Apache-2.0 Imports: 4 Imported by: ? 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 AESDecrypt

func AESDecrypt(ciphertext, key []byte) ([]byte, error)

AESDecrypt decrypts a payload encrypted using AES-CBC and PKCS#7 padding. The decryption algorithm makes three assumptions: 1. ciphertext is aligned to the standard AES block size 2. ciphertext is padded using PKCS#7 3. the IV is prepended to ciphertext This function is DEPRECATED. Use Decrypt() instead.

func AESEncrypt

func AESEncrypt(plaintext, key []byte) ([]byte, error)

AESEncrypt encrypts a payload using AES-CBC and PKCS#7 padding. The returned ciphertext has three notable properties: 1. ciphertext is aligned to the standard AES block size 2. ciphertext is padded using PKCS#7 3. IV is prepended to the ciphertext This function is DEPRECATED. Use Encrypt() instead.

func Decrypt added in v0.2.0

func Decrypt(ciphertext, key []byte) (plaintext []byte, err error)

Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.

func Encrypt added in v0.2.0

func Encrypt(plaintext, key []byte) (ciphertext []byte, err error)

Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.

func RandBytes

func RandBytes(n int) ([]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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