gluacrypto

package module
v0.0.0-...-54b58c9 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 2 Imported by: 3

README

LuaCrypto for GopherLua

A native Go implementation of crypto library for the GopherLua VM.

Using

Loading Modules
import (
	"github.com/tengattack/gluacrypto"
)

// Bring up a GopherLua VM
L := lua.NewState()
defer L.Close()

// Preload LuaCrypto modules
gluacrypto.Preload(L)
Encoding
  • base64
Hashing
  • crc32
  • md5
  • sha1
  • sha256
  • sha512
  • hmac
crypto.md5(input [, raw])
-- ...crc32, sha1, sha256, sha512
crypto.hmac(dtype, input, key [, raw])

If you need raw data output, set raw to true.

Encrypt/Decrypt Chiper Method
  • des-ecb
  • des-cbc
  • aes-cbc (key supports 128, 256, etc.)
crypto.encrypt(input, cipher, key, options, iv)
crypto.decrypt(input, cipher, key, options, iv)

If you need raw data input/output, using crypto.RAW_DATA as options, otherwise set it to 0.

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preload

func Preload(L *lua.LState)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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