Skip to content

Instantly share code, notes, and snippets.

View tiansin's full-sized avatar
🌴
On vacation

tiansin tiansin

🌴
On vacation
View GitHub Profile
@tiansin
tiansin / rc4.js
Created February 5, 2017 16:47 — forked from farhadi/rc4.js
RC4 encryption in javascript and php
/*
* RC4 symmetric cipher encryption/decryption
*
* @license Public Domain
* @param string key - secret key for encryption/decryption
* @param string str - string to be encrypted/decrypted
* @return string
*/
function rc4(key, str) {
var s = [], j = 0, x, res = '';