node-forge
Advanced tools
Comparing version 0.7.3 to 0.7.4
Forge ChangeLog | ||
=============== | ||
## 0.7.4 - 2018-03-07 | ||
### Fixed | ||
- Potential regex denial of service in form.js. | ||
### Added | ||
- Support for ED25519. | ||
- Support for baseN/base58. | ||
## 0.7.3 - 2018-03-05 | ||
@@ -5,0 +14,0 @@ |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
var _regex = /(.*?)\[(.*?)\]/g; | ||
var _regex = /([^\[]*?)\[(.*?)\]/g; | ||
@@ -23,0 +23,0 @@ /** |
@@ -15,2 +15,3 @@ /** | ||
require('./des'); | ||
require('./ed25519'); | ||
require('./hmac'); | ||
@@ -17,0 +18,0 @@ require('./kem'); |
{ | ||
"name": "node-forge", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.", | ||
@@ -37,7 +37,7 @@ "homepage": "https://github.com/digitalbazaar/forge", | ||
"karma-tap-reporter": "0.0.6", | ||
"karma-webpack": "^2.0.12", | ||
"karma-webpack": "^2.0.13", | ||
"mocha": "^5.0.1", | ||
"mocha-lcov-reporter": "^1.2.0", | ||
"nodejs-websocket": "^1.7.1", | ||
"nyc": "^11.4.1", | ||
"nyc": "^11.5.0", | ||
"opts": "^1.2.2", | ||
@@ -44,0 +44,0 @@ "webpack": "^3.11.0" |
@@ -56,2 +56,3 @@ # Forge | ||
* [ED25519](#ed25519) | ||
* [RSA](#rsa) | ||
@@ -867,5 +868,89 @@ * [RSA-KEM](#rsakem) | ||
Provides [X.509][] certificate and RSA public and private key encoding, | ||
decoding, encryption/decryption, and signing/verifying. | ||
Provides [X.509][] certificate support, ED25519 key generation and | ||
signing/verifying, and RSA public and private key encoding, decoding, | ||
encryption/decryption, and signing/verifying. | ||
<a name="ed25519" /> | ||
### ED25519 | ||
Special thanks to [TweetNaCl.js][] for providing the bulk of the implementation. | ||
__Examples__ | ||
```js | ||
var ed25519 = forge.pki.ed25519; | ||
// generate a random ED25519 keypair | ||
var keypair = ed25519.generateKeyPair(); | ||
// `keypair.publicKey` is a node.js Buffer or Uint8Array | ||
// `keypair.privateKey` is a node.js Buffer or Uint8Array | ||
// generate a random ED25519 keypair based on a random 32-byte seed | ||
var seed = forge.random.getBytesSync(32); | ||
var keypair = ed25519.generateKeyPair({seed: seed}); | ||
// generate a random ED25519 keypair based on a "password" 32-byte seed | ||
var password = 'Mai9ohgh6ahxee0jutheew0pungoozil'; | ||
var seed = new forge.util.ByteBuffer(password, 'utf8'); | ||
var keypair = ed25519.generateKeyPair({seed: seed}); | ||
// sign a UTF-8 message | ||
var signature = ED25519.sign({ | ||
message: 'test', | ||
// also accepts `binary` if you want to pass a binary string | ||
encoding: 'utf8', | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, binary string | ||
privateKey: privateKey | ||
}); | ||
// `signature` is a node.js Buffer or Uint8Array | ||
// sign a message passed as a buffer | ||
var signature = ED25519.sign({ | ||
// also accepts a forge ByteBuffer or Uint8Array | ||
message: new Buffer('test', 'utf8'), | ||
privateKey: privateKey | ||
}); | ||
// sign a message digest (shorter "message" == better performance) | ||
var md = forge.md.sha256.create(); | ||
md.update('test', 'utf8'); | ||
var signature = ED25519.sign({ | ||
md: md, | ||
privateKey: privateKey | ||
}); | ||
// verify a signature on a UTF-8 message | ||
var verified = ED25519.verify({ | ||
message: 'test', | ||
encoding: 'utf8', | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
signature: signature, | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
publicKey: publicKey | ||
}); | ||
// `verified` is true/false | ||
// sign a message passed as a buffer | ||
var verified = ED25519.verify({ | ||
// also accepts a forge ByteBuffer or Uint8Array | ||
message: new Buffer('test', 'utf8'), | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
signature: signature, | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
publicKey: publicKey | ||
}); | ||
// verify a signature on a message digest | ||
var md = forge.md.sha256.create(); | ||
md.update('test', 'utf8'); | ||
var verified = ED25519.verify({ | ||
md: md, | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
signature: signature, | ||
// node.js Buffer, Uint8Array, forge ByteBuffer, or binary string | ||
publicKey: publicKey | ||
}); | ||
``` | ||
<a name="rsa" /> | ||
@@ -2012,1 +2097,2 @@ | ||
[webpack]: https://webpack.github.io/ | ||
[TweetNaCl]: https://github.com/dchest/tweetnacl-js |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1670853
62
31404
2096