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

appc-security

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appc-security - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

10

index.js

@@ -115,6 +115,4 @@ /**

// encrypt the plainText
cipher.setEncoding('hex');
cipher.write(plainText);
cipher.end();
var encrypted = cipher.read();
var encrypted = cipher.update(plainText,'utf-8','hex');
encrypted += cipher.final('hex');

@@ -237,4 +235,4 @@ // create an HMAC of the encrypted value + the saltAndPepper + the iv

cipher.update(encrypted,'hex','utf8');
return cipher.final('utf8');
var decrypted = cipher.update(encrypted,'hex','utf-8');
return decrypted + cipher.final('utf-8');
}

@@ -241,0 +239,0 @@ catch (E) {

2

package.json
{
"name": "appc-security",
"version": "0.0.3",
"version": "0.0.4",
"description": "Appcelerator Security Best Practices Library for Node",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -153,2 +153,16 @@ var should = require('should'),

it('should encrypt json string', function(){
var key = lib.generateLargeRandomValue(),
pepper = lib.generateLargeRandomValue(),
hmacKey = lib.generateLargeRandomValue(),
json = JSON.stringify({user:'foo',org:'bar'}),
result = lib.encrypt(json,key,pepper,hmacKey);
should(result).be.object;
should(result.value).not.match(/=$/);
var result2 = lib.decrypt(result.value,key,pepper,hmacKey);
should(result2).be.string;
should(result2).equal(json);
});
it('should encrypt fail with invalid encoding', function(){

@@ -155,0 +169,0 @@ var key = lib.generateLargeRandomValue(),

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