browserify / browserify/diffie-hellman

nodejs crypto module DH secret hash is not the same with diffie-hellman/browser

オープン
#30 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
95
フォーク
26
PR マージ指標
30日以内にマージされた PR はありません

説明

I do a test about crypto module with diffie-hellman/browser

- When I use the followed , DH secret hex is not the same,
```
var dh1_secret = dh1.computeSecret(dh2.getPublicKey('hex'), 'hex');
var dh2_secret = dh2.computeSecret(dh1.getPublicKey('hex'), 'hex');

console.log(dh1_secret.toString('hex') === dh2_secret.toString('hex')); // false
```

- when I use the followed, DH secret is the same,
```
var dh1_secret = dh1.computeSecret(dh2.getPublicKey());
var dh2_secret = dh2.computeSecret(dh1.getPublicKey()); // true
```

**The followed is the completed code.**
```
var myCrypto = require('./browser');
var crypto = require('./');

p1 = "modp18"
var dh1 = myCrypto.getDiffieHellman(p1);
let dh1_secret_key = dh1.generateKeys();

let dh1_pk = dh1.getPublicKey('hex');

let dh2 = myCrypto.getDiffieHellman(p1);
let dh2_secret_key = dh2.generateKeys();

var dh1_secret = dh1.computeSecret(dh2.getPublicKey('hex'), 'hex');
var dh2_secret = dh2.computeSecret(dh1.getPublicKey('hex'), 'hex');

console.log(dh1_secret.toString('hex') === dh2_secret.toString('hex'));
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず、./browser 経由で使用されるブラウザー実装と ./ 経由で使用される通常のモジュールを比較し、getDiffieHellman、getPublicKey('hex')、computeSecret(..., 'hex') に焦点を当てます。modp18 の例を再現し、両側が同一の 16 進数のシークレットを生成するか確認してください。不一致の理由が説明され、示された呼び出しをカバーするリグレッションチェックがあれば、issue は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
cryptography
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。