Skip to content

XXTEA for encryption algorithm library JavaScript.

License

Notifications You must be signed in to change notification settings

NotASithLord/xxtea-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XXTEA for JavaScript

XXTEA logo

Build Status Gitter bower version GitHub release License

Sauce Test Status

Introduction

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

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts String instead of uint32 Array, and the key is also String.

Usage

<!DOCTYPE html>
<html>
    <head>
        <title>XXTEA test</title>
        <meta charset="UTF-8">
        <script src="dist/xxtea.min.js" type="text/javascript"></script>
    </head>
    <body>
        <script type="text/javascript">
            var str = "Hello World! 你好,中国!";
            var key = "1234567890";
            var encrypt_data = XXTEA.encryptToBase64(str, key);
            console.log(encrypt_data);
            var decrypt_data = XXTEA.decryptFromBase64(encrypt_data, key);
            console.assert(str === decrypt_data);
        </script>
    </body>
</html>

About

XXTEA for encryption algorithm library JavaScript.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.0%
  • CSS 1.4%
  • HTML 0.6%