Data encryption and decryption tool
- Zero dependencies.
- Works with any NodeJs projects.
- High performance and security.
- Simple usage.
See examples in: https://encrypt.anselmo.dev.br
$ npm i encrypt-char
or
$ yarn add encrypt-char
import { encryptChar } from 'encrypt-char';
const mySalt = 6;
const mySecretPassword = 'secretPassword1234';
const myKeychar = encryptChar.generateKey(mySalt, mySecretPassword);
// return BEGIN KEY ---34230LPRYjLw0kaNhXUtNmdk0juT0278W756LH9MNox2....--- END KEY
import { encryptChar } from 'encrypt-char';
const mySecretPassword = 'secretPassword1234';
const myText = 'Lorem ipsum dolor sit amet. 1234567890 !@#$%^&*()_+';
const resultEncode = encryptChar.hardEncode(
myText,
myKeychar,
mySecretPassword
);
// return 'hYjIzzH1Mjw1no7CeoA5Flnb3VQR6PKC4VmxZJLC9s2leCGv0NLxe9fdQUmDe9fx6NLA'
import { encryptChar } from 'encrypt-char';
const mySecretPassword = 'secretPassword1234';
const myEncodedText =
'hYjIzzH1Mjw1no7CeoA5Flnb3VQR6PKC4VmxZJLC9s2leCGv0NLxe9fdQUmDe9fx6NLA';
const resultDecode = encryptChar.hardDecode(
myEncodedText,
myKeychar,
mySecretPassword
);
// return 'Lorem ipsum dolor sit amet. 1234567890 !@#$%^&*()_+'
import { encryptChar } from 'encrypt-char';
const myText = 'Lorem ipsum dolor sit amet. 1234567890 !@#$%^&*()_+';
const resultEncode = encryptChar.softEncode(myText);
// return 'r8VKooiJeVCJjAUIgATO4cjN1QzMyEDIuQXZtFGI0l2cgI3bs9GZg0WdzBXag0WZy9GT'
import { encryptChar } from 'encrypt-char';
const myEncodedText =
'r8VKooiJeVCJjAUIgATO4cjN1QzMyEDIuQXZtFGI0l2cgI3bs9GZg0WdzBXag0WZy9GT';
const resultDecode = encryptChar.softDecode(myEncodedText);
// return 'Lorem ipsum dolor sit amet. 1234567890 !@#$%^&*()_+'
The "salt" to increase the encoding complexity.
The "password" to sign and validate keychar.
The "data" text to encode.
The "keychar" generated to encode text.
The "password" to sign and validate keychar.
The "encodedData" text previously encoded.
The "keychar" generated to decode text.
The "password" to sign and validate keychar.
The "data" text to encode.
The "encodedData" text previously encoded.
The "keychar" is a unique key that guarantees encoding and decoding using only in "hardEncode" and "hardDecode" methods. Losing the "keychar" or "password" makes it impossible to reverse any encoded text.
@anselmodev |
---|