cryptoutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2016 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseASN1RSAPublicKey

func ParseASN1RSAPublicKey(derBytes []byte) (*rsa.PublicKey, error)

Parses a DER encoded RSA public key

func RSAEncrypt

func RSAEncrypt(pub *rsa.PublicKey, msg []byte) []byte

Encrypts a message with the given public key using RSA-OAEP and the sha1 hash function.

func SymmetricDecrypt

func SymmetricDecrypt(ciph cipher.Block, src []byte) []byte

Decrypts data from the reader using AES/CBC/PKCS7 with an IV prepended using AES/ECB/None. The src slice may not be used anymore.

func SymmetricEncrypt

func SymmetricEncrypt(ciph cipher.Block, src []byte) []byte

Performs an encryption using AES/CBC/PKCS7 with a random IV prepended using AES/ECB/None.

Types

This section is empty.

Jump to

Keyboard shortcuts

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