Package Exports
- magiccrypt
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (magiccrypt) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MagicCrypt
For Node.js
Encrypt
You can use encrypt method to encrypt any string. For example,
const mc = new MagicCrypt('magickey', 256);
console.log(mc.encrypt('http://magiclen.org'));
The result is,
DS/2U8royDnJDiNY2ps3f6ZoTbpZo8ZtUGYLGEjwLDQ=
To encrypt any data buffer to a base64 string,
const mc = new MagicCrypt('magickey', 256);
console.log(mc.encryptData(buffer));
Decrypt
You can use decrypt method to decrypt any encrypted string. For example,
const mc = new MagicCrypt('magickey', 256);
console.log(mc.decrypt('DS/2U8royDnJDiNY2ps3f6ZoTbpZo8ZtUGYLGEjwLDQ='));
The result is,
http://magiclen.org
To decrypt any base64 string to data buffer,
const mc = new MagicCrypt('magickey', 256);
const buffer = mc.decryptData(base64);
For Java
Refer to https://github.com/magiclen/MagicCrypt.
For PHP
Refer to https://github.com/magiclen/MagicCrypt.
For Rust
Refer to https://github.com/magiclen/rust-magiccrypt.