aesgcm

package
v0.1.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package aesgcm provides a simple API to symmetric key encrypt/decrypt with AES Galois/Counter Mode (GCM),

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKey

func CreateKey(size int) ([]byte, error)

CreateKey returns a valid key (secret) of a certain size, to be used when encrypting/decrypting AES.

This function should be used by applications importing this lib. E.g by servers where the key must be known to the clients where encryption is involved.

func Decrypt

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

Decrypt returns the decrypted message where the provided key must be the same key used when encrypting the message.

func Encrypt

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

Encrypt returns the encrypted message where the provided key has been used during encryption.

Types

type KeySize

type KeySize int

Size of key in bytes

Jump to

Keyboard shortcuts

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