GithubHelp home page GithubHelp logo

2188886665 / aeslua Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bighil/aeslua

0.0 1.0 0.0 168 KB

Implementation of aes in nearly pure lua (bitlib is required)

License: Other

Lua 100.00%

aeslua's Introduction

AES for lua
-----------

This files contain an implementation of AES in lua. The only additional library 
needed is bitlib.

Usage
-----

aeslua.lua contains a simple API to encrypt and decrypt lua strings.

To encrypt the string "geheim" with the password "password" use:

require("aeslua");
cipher = aeslua.encrypt("password", "secret");

and to decrypt the string again:

plain = aeslua.decrypt("password", cipher);

You can also specify the key size and the encryption mode. For further examples
look into the file src/testcryptotest.lua.

To use AES directly, have a look at aes.lua and at the example usage in 
testaes.lua.

Installation
------------

Edit the LIBDIR variable in the Makefile and run

make install

Speed
-----

The implementation is rather optimized (it uses tables for most AES operations) 
but still cannot compete with AES written in other languages. Typical AES 
implementations reach several 100 MBit per second, this implementation only 
reaches 400 kBit per second. The most plausible reason is the heavy reliance
of AES on bit operations. As lua numbers are doubles bitlib needs to convert
them to long values for each bit operation.

So if you need to encrypt much data with AES, do yourself a favor and use a 
C-Implementation. But if you only need to encrypt short strings and you have 
no control over the lua environment (like in games :-)) use this library.

Matthias Hilbig <[email protected]>

aeslua's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.