Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 857 Bytes

README.md

File metadata and controls

36 lines (23 loc) · 857 Bytes

JQueryRC4: RC4 Encryption Library

Version: 1.0.0

Light weight (<3kb) reversible encryption library for JQuery.

Recommendations

Limit encryption usage to OTP or include a nonce with the key to prevent known security vulnerability of RC4 (same as WEP).

Options

key: null
method: "encrypt"

Usage

Decrypt all element text for class using key "ThisIsAGreatKey"

$(".EncryptedText").rc4({"key":"ThisIsAGreatKey","method":"decrypt"});

Encrypt all input value for class using key "ThisIsAGreatKey"

$(".SecureInput").rc4({"key":"ThisIsAGreatKey"});  //encrypting is the default method

Encrypt a string and store to variable

var jsonMSG = {"to":"johndoe@fakeemail.com","msg": $.rc4Encrypt($('#plainTextInput').val(),$('#key').val())};

Notes

Tested with UTF-8 encoding