8000 GitHub - xxtea/xxtea-js: XXTEA for encryption algorithm library JavaScript.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xxtea/xxtea-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 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
0