1.0.1 • Published 7 years ago

kwl-encrypt v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

KWL Encrypt

Description

JavaScript Encrypt implementation for KWL. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.

Usage

Client-side

Include the (minified) JavaScript file in your HTML markup:

<script src="js/kwlencrypt.min.js"></script>

In your application code, calculate the kwlencrypt hash of a string by calling the kwlencrypt method with the string as argument:

// encrypt your request string
var hash = kwlEncrypt('request string', '0', {desKey: '', channel: '', rsaPublicKey: ''});
// decrypt the response string
var res = kwlEncrypt('response string', '1', {desKey: ''});
// encrypt the password by rsa
var pwd = kwlEncrypt('pwd', '2', {pwdKey: '', rsaPwdKey: ''});

Server-side

The following is an example how to use the JavaScript MD5 module on the server-side with Node.js.

Create a new directory and add the file. Or alternatively, install the package with npm:

npm install kwl-encrypt

Add with the following content:

// The kwlEncrypt module exports the kwlEncrypt() function:
var kwlEncrypt = require("./kwlEncrypt");

License

The JavaScript kwlEncrypt script is released under the ISC license.

1.0.1

7 years ago

1.0.0

7 years ago