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

secret-handshake

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secret-handshake - npm Package Compare versions

Comparing version 1.1.2 to 1.1.4

crypto.js

33

index.js

@@ -1,38 +0,11 @@

var handshake = require('./handshake')
var secure = require('./secure')
var cl = require('chloride')
'use strict'
module.exports = require('./protocol')(require('./crypto'))
function isBuffer(buf, len) {
return Buffer.isBuffer(buf) && buf.length === len
}
exports.client =
exports.createClient = function (alice, app_key, timeout) {
var create = handshake.client(alice, app_key, timeout)
return function (bob, seed, cb) {
if(!isBuffer(bob, 32))
throw new Error('createClient *must* be passed a public key')
if('function' === typeof seed)
return create(bob, secure(seed))
else
return create(bob, seed, secure(cb))
}
}
exports.server =
exports.createServer = function (bob, authorize, app_key, timeout) {
var create = handshake.server(bob, authorize, app_key, timeout)
return function (cb) {
return create(secure(cb))
}
}
exports.toKeys = function (keys) {
if(isBuffer(keys, 32))
return cl.crypto_sign_seed_keypair(keys)
return keys
}
{
"name": "secret-handshake",
"description": "a simple and highly private secure-channel protocol",
"version": "1.1.2",
"version": "1.1.4",
"homepage": "https://github.com/dominictarr/secret-handshake",

@@ -18,7 +18,8 @@ "repository": {

"devDependencies": {
"pull-bitflipper": "~0.1.0",
"pull-defer": "^0.2.2",
"pull-bitflipper": "~0.1.0",
"pull-hang": "0.0.0",
"stream-to-pull-stream": "~1.6.1",
"tape": "~4.0.0"
"tape": "~4.0.0",
"test-secret-handshake": "^1.0.0"
},

@@ -25,0 +26,0 @@ "scripts": {

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