EncriptorJS is a JavaScript text encryption library that allows you to securely encrypt and decrypt text. It provides a simple interface to convert your text into an encrypted form and optionally add a key for additional security. Only the correct key can be used to decrypt the text, ensuring that unauthorized access is prevented.
You can use EncriptorJS by including the library in your JavaScript project or HTML file.
encriptor.js
) from the GitHub repository.encriptor.js
file into your project directory.import Encriptor from './encriptor.js';
encriptor.js
) from the GitHub repository.encriptor.js
file into your project directory.<script src="encriptor.js"></script>
<script src="https://encriptorjs.sh20raj.repl.co/encriptor.js"></script>
Once you have included the EncriptorJS library in your project, you can start encrypting and decrypting text.
To encrypt text, use the encrypt
method of the Encriptor
object. Here's an example:
const text = 'My name is Sh';
const key = '1234';
const encryptedText = Encriptor.encrypt(text, key);
console.log(encryptedText); // Outputs :- 'Kcdew9zdYidBf'
The encrypt
method takes two parameters: the text
you want to encrypt and an optional
key
for additional security. It is recommended to use only digits in the key
parameter. It
returns the encrypted text.
To decrypt the encrypted text, use the decrypt
method of the Encriptor
object. Here's an
example:
const encryptedText = 'Kcdew9zdYidBf'; // Replace with the encrypted text
const key = '1234';
const decryptedText = Encriptor.decrypt(encryptedText, key);
console.log(decryptedText); // Output :- 'My name is Sh'
The decrypt
method takes two parameters: the encryptedText
you want to decrypt and the
key
used during encryption. It returns the decrypted text.
You can find more examples in the examples directory of this repository. The examples demonstrate various use cases of the EncriptorJS library.
This project is licensed under the MIT License.