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

simple-encryptor

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-encryptor - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

index.js
var crypto = require('crypto');
var scmp = require('scmp');

@@ -78,2 +79,5 @@ // Arbitrary min length, nothing should shorter than this:

function decrypt(cipherText) {
if( !cipherText ) {
return null;
}
try {

@@ -87,3 +91,3 @@ if( verifyHmac ) {

var actualHmac = hmac(cipherText);
if( actualHmac != expectedHmac ) {
if( !scmp(actualHmac, expectedHmac) ) {
throw new Error('HMAC does not match');

@@ -90,0 +94,0 @@ }

5

package.json
{
"name": "simple-encryptor",
"version": "1.0.1",
"version": "1.0.2",
"description": "Simplified encryption/decryption for node.js",

@@ -29,3 +29,6 @@ "main": "index.js",

"mocha": "^1.21.0"
},
"dependencies": {
"scmp": "0.0.3"
}
}

@@ -106,5 +106,5 @@ # simple-encryptor

# Dependencies
None.
[scmp](https://www.npmjs.org/package/scmp) for constant-time string comparison.
# License
This plugin is released under the MIT license. See the file [LICENSE](LICENSE).
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