golea

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package golea implements Lightweight Encryption Algorithm

Index

Examples

Constants

View Source
const Blocksize int = 16

Blocksize LEA uses 16bit blocksize

Variables

This section is empty.

Functions

func NewCipher added in v1.0.1

func NewCipher(key []byte) (cipher.Block, error)

NewCipher returns a new cipher.Block

Example
lea, err := NewCipher([]byte("MySuperSecretKey"))
if err != nil {
	return
}
plaintext := []byte("Hello good world")
encrypted := make([]byte, 16)
decrypted := make([]byte, 16)
lea.Encrypt(encrypted, plaintext)
fmt.Printf("%x\n", encrypted)
lea.Decrypt(decrypted, encrypted)
fmt.Println(string(decrypted))
Output:

fd9eef064e2abe62a980a870779fab3d
Hello good world

Types

This section is empty.

Jump to

Keyboard shortcuts

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