Simple Javascript Encryptor / Decryptor to make your string or variable become secure. It will encrypt or Decrypt depend on your password.
DEMO (Codepen)
DEMO (JSBin)
Include the secure-string.js to your HTML or import it to your module (es6/node), Then it's ready to run.
/**
secureString()
@param {String} action -> 'encrypt' or 'decrypt'
@param {String} unsafeString -> String you want to encrypt/decrypt
@param {String} password -> password. using pure alphabet / number without whitespace or special character
@return {String}
*/
// Encrypt your string depend on your password
secureString('encrypt',"I'm a unsafeString",'yourPassword');
// return "q'K%208%20SLQ8DC0RPGLE"
// Decrypt your string depend on your password
secureString('decrypt',"q'K%208%20SLQ8DC0RPGLE",'yourPassword');
// return "I'm a unsafeString"
// When the password is wrong, it will not decrypt correctly
secureString('decrypt',"q'K%208%20SLQ8DC0RPGLE",'wrongPassword');
// return "v'P D XQVDIH5WULQJ"
Just Contact Me At:
- Email: bosnaufalemail@gmail.com
- Skype Id: bosnaufal254
- twitter: @BosNaufal
MIT Copyright (c) 2016 - forever Naufal Rabbani