crypto

package
v0.0.0-...-301f747 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package crypto provides utilities for various crytographic functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(data []byte) ([]byte, error)

AESDecrypt decrypts the data using AES-128.

func AESEncrypt

func AESEncrypt(data []byte) ([]byte, error)

AESEncrypt encrypts the data using AES-128.

func CompareHashAndPassword

func CompareHashAndPassword(hash string, password string) (bool, error)

CompareHashAndPassword checks if the hashed password matches the plain text one.

func GenerateFromPassword

func GenerateFromPassword(password string) (string, error)

GenerateFromPassword creates a hash from the plain text password.

func GenerateRandomKey

func GenerateRandomKey(strength int) []byte

GenerateRandomKey creates a random key with the given strength.

func Init

func Init(key string)

Init initializes the crypto package. Key must be 16 bytes long.

Types

This section is empty.

Jump to

Keyboard shortcuts

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