From a808761e3789b71ad9b066fc5836052bd70a64b0 Mon Sep 17 00:00:00 2001 From: cintolas Date: Wed, 12 Sep 2018 10:41:01 -0700 Subject: [PATCH 1/2] Verify Documentation does not match code Updated the doc to match the function signature in the code verify(publicKey, signature, decrypted) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f994cc..e403585 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ var encrypted = '{"v":"hybri... ..."signature":"sdL93kfd...'; var decrypted = crypt.decrypt(receiverPrivateKey, encrypted); // Verify message with ISSUER's public key -var verified = crypt.verify(issuerPublicKey, decrypted); +var verified = crypt.verify(issuerPublicKey, decrypted.signature, decrypted.message); ``` Verification function return *true* or *false* depending on whether the verification was successfull. From aa5f3d8bb2ad9e9d0c2dbdb2f0060de881784419 Mon Sep 17 00:00:00 2001 From: cintolas Date: Tue, 23 Oct 2018 11:05:43 -0700 Subject: [PATCH 2/2] added missing variable declaration --- lib/rsa.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rsa.js b/lib/rsa.js index 65d3ef2..e04fcaa 100644 --- a/lib/rsa.js +++ b/lib/rsa.js @@ -28,9 +28,9 @@ class RSA { } _entropy(input) { - bytes = forge.util.encodeUtf8(String(input)); + var bytes = forge.util.encodeUtf8(String(input)); forge.random.collect(bytes); } } -module.exports = RSA; \ No newline at end of file +module.exports = RSA;