Skip to content

Commit

Permalink
Merge pull request #13 from cintolas/master
Browse files Browse the repository at this point in the history
Fix for encrypt and verify functions
  • Loading branch information
juhoen committed Oct 24, 2018
2 parents d2442b7 + aa5f3d8 commit 021db58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions lib/rsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
module.exports = RSA;

0 comments on commit 021db58

Please sign in to comment.