4.0.3 • Published 7 months ago

magiccrypt v4.0.3

Weekly downloads
8
License
MIT
Repository
github
Last release
7 months ago

MagicCrypt

CI

MagicCrypt is a Java/PHP/NodeJS/Rust library to encrypt/decrpyt strings, files, or data, using Data Encryption Standard(DES) or Advanced Encryption Standard(AES) algorithms. It supports CBC block cipher mode, PKCS5 padding and 64, 128, 192 or 256-bits key length. If the encrypted data is a string, it will be formatted automatically to Base64.

You need to set up the Rust development environment: rustup

For Node.js

Encrypt

You can use encrypt method to encrypt any string. For example,

import { MagicCrypt } from "magiccrypt";

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,

import { MagicCrypt } from "magiccrypt";

const mc = new MagicCrypt("magickey", 256);
console.log(mc.encryptData(buffer));

Decrypt

You can use decrypt method to decrypt any encrypted string. For example,

import { MagicCrypt } from "magiccrypt";

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,

import { MagicCrypt } from "magiccrypt";

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.

License

MIT

4.0.3

7 months ago

4.0.1

1 year ago

4.0.0

1 year ago

4.0.2

12 months ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.2.5

3 years ago

2.2.7

3 years ago

2.2.6

3 years ago

2.2.4

4 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.2-a

7 years ago

2.0.2

7 years ago