This package has been deprecated

Author message:

please use ngx-simple-crypt instead

ng2-simple-crypt

1.0.1 • Public • Published

ng2-simple-crypt

Javascript module (compatible angular2+ but not limited to) for encryption through XOR cipher method.

Useful for hiding non sensitive informations, like code obfuscations, etc...

Import

npm i ng2-simple-crypt --save

Usage

import SimpleCrypt from 'ng2-simple-crypt';
let encodedString = SimpleCrypt.encode("my-key","You are not supposed to read this");
console.log(encodedString);// "NBZYSwQLCFlDBBFZHgxdGwoKCB0NHwpZHxxMD0UNBRBe"

let decodedString = SimpleCrypt.decode("my-key",encodedString);
console.log(decodedString);// "You are not supposed to read this"

From wikipedia:
The XOR operator is extremely common as a component in more complex ciphers. By itself, using a constant repeating key, a simple XOR cipher can trivially be broken using frequency analysis. If the content of any message can be guessed or otherwise known then the key can be revealed. Its primary merit is that it is simple to implement, and that the XOR operation is computationally inexpensive. A simple repeating XOR (i.e. using the same key for xor operation on the whole data) cipher is therefore sometimes used for hiding information in cases where no particular security is required.

Package Sidebar

Install

npm i ng2-simple-crypt

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • dfaure