Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crypto2

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto2 - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

30

lib/crypto2.js

@@ -24,10 +24,12 @@ 'use strict';

const createKeyPair = function (callback) {
/* eslint-disable id-length */
const key = new NodeRSA({ b: 2048, e: 65537 }, { environment: 'node', signingAlgorithm: 'sha256' });
/* eslint-enable id-length */
process.nextTick(() => {
/* eslint-disable id-length */
const key = new NodeRSA({ b: 2048, e: 65537 }, { environment: 'node', signingAlgorithm: 'sha256' });
/* eslint-enable id-length */
const privateKey = key.exportKey(),
publicKey = key.exportKey('public');
const privateKey = key.exportKey(),
publicKey = key.exportKey('public');
callback(null, privateKey, publicKey);
callback(null, privateKey, publicKey);
});
};

@@ -98,13 +100,17 @@

const rsaEncrypt = function (text, publicKey, callback) {
const key = new NodeRSA(publicKey);
const encryptedText = key.encrypt(text, 'base64', 'utf8');
process.nextTick(() => {
const key = new NodeRSA(publicKey);
const encryptedText = key.encrypt(text, 'base64', 'utf8');
callback(null, encryptedText);
callback(null, encryptedText);
});
};
const rsaDecrypt = function (text, privateKey, callback) {
const key = new NodeRSA(privateKey);
const decryptedText = key.decrypt(text, 'utf8');
process.nextTick(() => {
const key = new NodeRSA(privateKey);
const decryptedText = key.decrypt(text, 'utf8');
callback(null, decryptedText);
callback(null, decryptedText);
});
};

@@ -111,0 +117,0 @@

6

package.json
{
"name": "crypto2",
"version": "0.3.1",
"version": "0.3.2",
"description": "crypto2 is a convenience wrapper around Node.js' crypto module.",

@@ -13,2 +13,6 @@ "contributors": [

"email": "matthias.wagler@thenativeweb.io"
},
{
"name": "Joe Bell",
"email": "joe@jb-labs.uk"
}

@@ -15,0 +19,0 @@ ],

@@ -191,3 +191,3 @@ # crypto2

```bash
$ bot build-server
$ bot
```

@@ -198,3 +198,3 @@

The MIT License (MIT)
Copyright (c) 2013-2016 the native web.
Copyright (c) 2013-2017 the native web.

@@ -201,0 +201,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc