Skip to content

xxtea/xxtea-d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XXTEA for D

XXTEA logo

Build Status DUB DUB DUB DUB DUB DUB

Introduction

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

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.

Usage

This is a dub library (http://code.dlang.org/about). Just add dependancy to your package.json:

{
    ...
    "dependencies": {
        "xxtea": "~>1.0.0",
        ...
    }
}

A simple source code example is in the provided app.d and looks like this:

import xxtea;
import std.stdio;

void main() {
    auto text = "Hello World! 你好,中国!";
    auto key = "1234567890";
    auto encrypt_data = XXTEA.encryptToBase64(text, key);
    writeln(encrypt_data);
    auto decrypt_data = XXTEA.decryptFromBase64(encrypt_data, key);
    assert(text == decrypt_data);
}

About

XXTEA encryption algorithm library for D.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages