git ssb

1+

Dominic / ssb-keys



Commit 7f1bf9e79916feee154feb29bed1fadca5c04e4c

Merge branch 'master' of git://github.com/pfraze/ssb-keys

Dominic Tarr committed on 11/22/2014, 2:48:18 PM
Parent: f49ed9d612208d9cfa2e456cbbdc329ddf133cdf
Parent: 6c030d1ba292d2341fe3d4497374c3536d3d0566

Files changed

README.mdchanged
package.jsonchanged
README.mdView
@@ -1,37 +1,52 @@
11 # SSB-Keys
22
3-A common module for secure-scuttlebutt projects, provides an API to create or load elliptic-curve keypairs.
3+A common module for secure-scuttlebutt projects, provides an API to create or load elliptic-curve keypairs and to execute related crypto operations.
44
55 ```js
66 var ssbkeys = require('ssb-keys')
77
88 ssbkeys.create(path, function(err, k) {
99 console.log(k) /* => {
10- id: Buffer(...),
11- public: Buffer(...),
12- private: Buffer(...)
10+ id: String,
11+ public: String,
12+ private: String
1313 }*/
1414 })
1515
1616 ssbkeys.load(path, function(err, k) {
1717 console.log(k) /* => {
18- id: Buffer(...),
19- public: Buffer(...),
20- private: Buffer(...)
18+ id: String,
19+ public: String,
20+ private: String
2121 }*/
2222 })
2323
2424 var k = ssbkeys.createSync(path)
2525 console.log(k) /* => {
26- id: Buffer(...),
27- public: Buffer(...),
28- private: Buffer(...)
26+ id: String,
27+ public: String,
28+ private: String
2929 }*/
3030
3131 var k = ssbkeys.loadSync(path)
3232 console.log(k) /* => {
33- id: Buffer(...),
34- public: Buffer(...),
35- private: Buffer(...)
33+ id: String,
34+ public: String,
35+ private: String
3636 }*/
37+
38+var k = ssbkeys.generate()
39+console.log(k) /* => {
40+ id: String,
41+ public: String,
42+ private: String
43+}*/
44+
45+var hash = ssbkeys.hash(new Buffer('deadbeef', 'hex'))
46+ssbkeys.isHash(hash) // => true
47+
48+var sig = ssbkeys.sign(k, hash)
49+ssbkeys.verify(k.public, sig, hash)
50+
51+ssbkeys.hmac(new Buffer('deadbeef', 'hex'), k.private) // => String
3752 ```
package.jsonView
@@ -1,8 +1,8 @@
11 {
22 "name": "ssb-keys",
33 "description": "create or load a keypair file for secure-scuttlebutt",
4- "version": "0.2.1",
4+ "version": "0.3.0",
55 "homepage": "https://github.com/pfraze/ssb-keys",
66 "repository": {
77 "type": "git",
88 "url": "git://github.com/pfraze/ssb-crypto.git"

Built with git-ssb-web