
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
encriptorjs
Advanced tools
JavaScript text encryption library for secure encryption and decryption.
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.module.js';
or Use
npm i encriptorjs
import Encriptor from 'encriptorjs';
Download the EncriptorJS library file (encriptor.js
) from the GitHub repository or NPMJS.
Move the encriptor.js
file into your project directory.
In your HTML file, add the following script tag:
<script src="encriptor.js"></script>
or
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/EncriptorJS@main/encriptor.min.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); // Outputs: '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.
The EncriptorJS library also provides a utility function called shuffleString
that can be used to shuffle strings using a key. Here's how you can use it:
const text = 'Hello, World!';
const shuffledText = Encriptor.shuffleString(text, 42);
console.log(shuffledText); // Outputs a shuffled version of the input string
The shuffleString
function takes a text
parameter as the input string and an optional key
parameter used to initialize the random number generator. By using the same key, you can obtain the same shuffled result. This function can be used for encryption purposes or to shuffle strings for other applications.
Please note that the shuffleString
function alone does not provide strong encryption. For secure encryption, it is recommended to use well-established encryption algorithms and libraries designed for that purpose.
Encriptor.shuffle(text)
always gives different shuffled pattern.
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.
https://dev.to/sh20raj/creating-a-custom-javascript-function-to-shuffle-strings-with-a-key-parameter-3c8a https://dev.to/sh20raj/introducing-encriptorjs-secure-text-encryption-and-decryption-in-javascript-a-jwt-easy-to-use-alternative-l02
FAQs
JavaScript text encryption library for secure encryption and decryption.
The npm package encriptorjs receives a total of 24 weekly downloads. As such, encriptorjs popularity was classified as not popular.
We found that encriptorjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.