simple-encryptor
Advanced tools
Comparing version 1.0.1 to 1.0.2
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 @@ } |
{ | ||
"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). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13066
170
1
+ Addedscmp@0.0.3
+ Addedscmp@0.0.3(transitive)