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

doichain

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doichain - npm Package Compare versions

Comparing version 0.0.41 to 0.0.42

lib/getPrivateKeyFromWif.js

4

index.js

@@ -26,2 +26,3 @@ import * as constants from "./lib/constants"

import createDoichainEntry from "./lib/createDoichainEntry"
import getPrivateKeyFromWif from "./lib/getPrivateKeyFromWif"

@@ -53,3 +54,4 @@ export {

decryptStandardECIES,
createDoichainEntry
createDoichainEntry,
getPrivateKeyFromWif
}
{
"name": "doichain",
"version": "0.0.41",
"version": "0.0.42",
"description": "A js-Doichain library. The goal is to fully cover the Doichain protocol",

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

@@ -34,2 +34,3 @@ import chai from 'chai'

import encryptStandardECIES from "../lib/encryptStandardECIES"
import getPrivateKeyFromWif from "../lib/getPrivateKeyFromWif"

@@ -258,3 +259,10 @@

function rng () {
changeNetwork('regtest')
const wif = "cP3EigkzsWuyKEmxk8cC6qXYb4ZjwUo5vzvZpAPmDQ83RCgXQruj"
var keyPair = bitcoin.ECPair.fromWIF(wif,DOICHAIN_REGTEST)
var publicKey = keyPair.publicKey.toString('hex')
const privateKeyOfBob2 = getPrivateKeyFromWif(wif,DOICHAIN_REGTEST)
/* function rng () {
return Buffer.from('zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz')

@@ -265,7 +273,8 @@ } // get a much more secure random

const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey })
//console.log("address " + address) // 17wqX8P6kz6DrDRQfdJ9KeqUTRmgh1NzSk
var publicKey = keyPair.publicKey.toString('hex')
//console.log("address " + address) // 17wqX8P6kz6DrDRQfdJ9KeqUTRmgh1NzSk*/
// var publicKey = keyPair.publicKey.toString('hex')
//console.log("public key " + publicKey) // 0279bf075bae171835513be1056f224f94f3915f9999a3faea1194d97b54397219
var wif = keyPair.toWIF()
//console.log("private key WIF " + wif) // 200424e3612358db9078760d4f652a105049187c29f2d03d7d65bc9e27a007d0

@@ -275,3 +284,3 @@

const publicKeyOfBob2 = publicKey
const privateKeyOfBob2 = keyPair.privateKey.toString('hex')
const encryptedMessage2 = encryptStandardECIES(publicKeyOfBob2,message2)

@@ -278,0 +287,0 @@ const decryptedMessage2 = decryptStandardECIES(privateKeyOfBob2,encryptedMessage2)

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