aes

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.

Index

Examples

Constants

View Source
const DefaultKey = "aes-key"

DefaultKey default aes key

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(src, key []byte) (dst []byte, err error)

Decrypt decrypts the first block in src into dst. Dst and src may point at the same memory.

Example
tt := aesTests[0]
dst, _ := aes.Decrypt(tt.out, tt.key)
fmt.Println(bytes.Compare(tt.in, dst))
Output:

0

func DecryptHex

func DecryptHex(src, key string) (dst string, err error)

DecryptHex decrypts the first block in src into dst.

Example
package main

import (
	"fmt"

	"gopkg.in/goyy/goyy.v0/util/crypto/aes"
)

func main() {
	dst, _ := aes.DecryptHex("efe9f867", "key")
	fmt.Println(dst)

}
Output:

goyy

func Encrypt

func Encrypt(src, key []byte) (dst []byte, err error)

Encrypt encrypts the first block in src into dst. Dst and src may point at the same memory.

Example
tt := aesTests[0]
dst, _ := aes.Encrypt(tt.in, tt.key)
fmt.Println(bytes.Compare(tt.out, dst))
Output:

0

func EncryptHex

func EncryptHex(src, key string) (dst string, err error)

EncryptHex encrypts the first block in src into dst.

Example
package main

import (
	"fmt"

	"gopkg.in/goyy/goyy.v0/util/crypto/aes"
)

func main() {
	dst, _ := aes.EncryptHex("goyy", "key")
	fmt.Println(dst)

}
Output:

efe9f867

Types

This section is empty.

Jump to

Keyboard shortcuts

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