Skip to content

xxtea/xxtea-lua

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

XXTEA for Lua

XXTEA logo

Introduction

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for Lua.

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts raw binary data instead of 32bit integer array, and the key is also the raw binary data.

Installation

luarocks install xxtea

Usage

local xxtea = require("xxtea");

local text = "Hello World! 你好,中国!";
local key = "1234567890";
local encrypt_data = xxtea.encrypt(text, key);
local decrypt_data = xxtea.decrypt(encrypt_data, key);
if text == decrypt_data then
    print("success!\n");
else
    print("fail!\n");
end

About

XXTEA encryption algorithm library for Lua.

Resources

License

Stars

Watchers

Forks

Packages

No packages published