snowdream / xxtea-android

jni wrapper for https://github.com/xxtea/xxtea-c

Repository from Github https://github.comsnowdream/xxtea-androidRepository from Github https://github.comsnowdream/xxtea-android

xxtea-android

License

Introduction

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for C with JNI.

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts byte[] instead of 32bit integer array, and the key is also the byte[].

In addition to providing the API of byte[] encryption and decryption, it also provides some methods to handle string and Base64 encode.

Usage

package org.xxtea.test;

import org.xxtea.XXTEA;

public class Main {
    public static void main(String[] args) {
              String text = "Hello World! 你好,**!";
              String ciphertext = XXTEA.encrypt(text);
              String plaintext = XXTEA.decrypt(ciphertext);
              
              assert (text.equals(plaintext));
    }
}

About

jni wrapper for https://github.com/xxtea/xxtea-c


Languages

Language:C 75.5%Language:Java 17.1%Language:CMake 7.4%