git ssb

1+

Dominic / ssb-keys



Commit 9d42020d0c0999f33e691eec65d6216b095a2cab

method to generate a random encryption key (32 bytes as base64)

Dominic Tarr committed on 2/4/2017, 9:14:45 AM
Parent: 1f80eb811659fb473d6119b6cb642a511ad9466f

Files changed

index.jschanged
index.jsView
@@ -118,9 +118,9 @@
118118 isBuffer(msg) ? msg : new Buffer(msg)
119119 )
120120 }
121121
122-// OTHER CRYTPO FUNCTIONS
122 +// OTHER CRYPTO FUNCTIONS
123123
124124 exports.signObj = function (keys, hmac_key, obj) {
125125 if(!obj) obj = hmac_key, hmac_key = null
126126 var _obj = clone(obj)
@@ -157,4 +157,9 @@
157157 var msg = pb.multibox_open(boxed, sk)
158158 if(msg) return JSON.parse(''+msg)
159159 }
160160
161 +exports.randomKey = function () {
162 + var b = new Buffer(32)
163 + sodium.randombytes(b, 32)
164 + return b.toString('base64')
165 +}

Built with git-ssb-web