npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

encrypt-magic-master

v0.1.11

Published

Hybrid (RSA+AES) encryption and decryption toolkit for JavaScript

Downloads

3

Readme

Encrypt Magic Master

Introduction This library acts as an encryption and decryption toolkit, both symmetric (AES) and asymmetric (RSA). Does not use hybrid methods (RSA + AES) for JavaScript, it allows them to work separately, to decide what to encrypt symmetrically and asymmetrically.

Includes automatic and persistent password management in React Native.

It combines RSA and AES encryption algorithms that make it possible to efficiently encrypt and decrypt large messages. This multiplatform library is based on Forge.

Includes diacritical normalization strategies to solve characters that can not be decrypted with normalize NFD or with node util decode utf-8. This solution was implemented due

Documentation

Starting

Introduction Documentation Installation Features

Initialization Encryption Decoded Firms Verifying RSA key pairs React with the management of native keys. Installation

npm install encrypt-magic-master Importer Node.js

var RSA = require ('encrypt-magic-master'). RSA; var Crypt = require ('encrypt-magic-master'). crypt React native

amount {Crypt, RSA} from 'encrypt-magic-master'; Web

Initialization

// Basic initialization var crypt = new Crypt (); var rsa = new RSA ();   // Increase the amount of entropy var entropy = "Random, integer or floating string"; var crypt = new Crypt ({entropy: entropy}); var rsa = new RSA ({entropy: entropy}); Encryption

Encrypt Magic Master grants the possibility of encrypting a key with a public key after having used it to symmetrically encrypt with AES a JSON chain.

 message var = 'Hello world! ';   // Encryption with a public RSA key encrypted var = crypt. encrypt (publicKey, message); Pretty printed sample output

{     "data": "HJGjhg654Jjhg6546587JFjfsd66584fshgFgkjHK64f66fd54sdf9687sf ==", // Current package version     "IV": "CmtyaZTyzoAp1mTNUTztic0v1 ...", // Initialization vector     "key": // Public Keys generated in memory to encrypt in RSA server         "----- PUBLIC KEY -----" }   Decoded

Deciphering the message with Encrypt Magic Master is as easy as encrypting. The decryption function can decrypt any message that has been encrypted with the public key in its key of the key pair in memory. The decrypted message is generated as a resolved JSON object.

var encrypted = '{"data": "jKHkjh786", "iv": "564SA65D4A", "key": "ASD654654dsf654a"}';

// Decrypt encrypted message with private RSA key var decrypted = crypt. decrypt (privateKey, encrypted);   // Get decrypted message  var = decrypted message message; Sample output

{     items: "{" parameter1 ":" value1 "," parameter2 ":" value2 "}", // actual decrypted message     count: "1" }

Firms

Encrypt Magic Master provides a simple message signature of 2048 bytes. When the sender signs a message, the receiver of the message can be sure of the sender of the message, in the same way with the signatures generated in memory, it is guaranteed that the sending server can only be read by the client receiving the response.

 message var = 'Hello world! ';   // Create a signature with the private RSA key of ISSUER  signature var = crypt. signature (issuerPrivateKey, message);   // Encrypt message with RSA public key RECEIVERS and attach the signature encrypted var = crypt. encrypt (message, signature); Verifying

The message receiver must have a public RSA key of the message sender to verify the sender of the message.

RSA key pairs

The key generation function is based on the generation function of Forge key pairs. As a difference, Encrypt Magic Master returns the pair of keys in PEM format.

// Initialize RSA class var rsa = new RSA ();   // Generate RSA key pair, 2048 bit key defaults RSA. generateKeypair (function (keypair) {       // The callback function receives a new pair of keys as the first argument     var PublicKey = pair of keys. publicKey;     var privateKey = pair of keys. privateKey; });