Skip to content

xxtea/xxtea-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XXTEA for .NET

XXTEA logo

Introduction

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

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.

Installation

git clone https://github.com/xxtea/xxtea-dotnet.git

Usage

using System;
using System.Diagnostics;
using Xxtea;

namespace Example {
    class MainClass {
        public static void Main (string[] args) {
            String str = "Hello World! 你好,中国!";
            String key = "1234567890";
            Byte[] encrypt_data = XXTEA.Encrypt(str, key);
            String decrypt_data = XXTEA.DecryptToString(encrypt_data, key);
            Debug.Assert(str == decrypt_data);
        }
    }
}

About

XXTEA encryption algorithm library for .NET.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages