crypto

package
v0.0.0-...-8b4e12d Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IVBlockSize = 16
	AESKeySize  = 32
	KeySize     = 4096
)

Defines key sizes and initialization vector size for AES encryption

Variables

This section is empty.

Functions

func CreateBase64EncodedPublicKey

func CreateBase64EncodedPublicKey(key *rsa.PrivateKey) (encodedKey []byte, e error)

CreateBase64EncodedPublicKey returns a textual representation of the pubilc key suitable for authorized_keys files

func DecryptAES

func DecryptAES(block cipher.Block, iv []byte, encrypted []byte) (unencrypted []byte)

DecryptAES decrypts a a string with symmetric encryption

func DecryptOAEP

func DecryptOAEP(privateKey crypto.PrivateKey, encrypted []byte) (decrypted []byte, e error)

DecryptOAEP decrypts a buffer

func EncryptAES

func EncryptAES(block cipher.Block, iv []byte, unencrypted []byte) (encrypted []byte)

EncryptAES Encrypt a string with symmetric encryption

func EncryptOAEP

func EncryptOAEP(publicKey crypto.PublicKey, unencrypted []byte) (encrypted []byte, e error)

EncryptOAEP encrypts a buffer

func GetPrivateKey

func GetPrivateKey(privateKeyPath string) (key *rsa.PrivateKey, e error)

GetPrivateKey returns a private key

func InitializeUcpDir

func InitializeUcpDir(ucpdir string) (e error)

Sets up directory used by UCP

func NewCipherBlock

func NewCipherBlock() (block cipher.Block, key []byte, e error)

NewCipherBlock returns a key that can be used for AES encryption

func UcpKeyGenerate

func UcpKeyGenerate(privateKeyPath, publicKeyPath string) (e error)

generates public/private keys and write each to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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