@dataparty/crypto
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "@dataparty/crypto", | ||
"private": false, | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "dataparty crypto routines", | ||
@@ -6,0 +6,0 @@ "main": "./dist/dataparty-crypto.js", |
@@ -17,3 +17,6 @@ # @dataparty/crypto | ||
* Password derived keys | ||
* Mnemonic derived keys seed phrases | ||
* `argon2id` - [See example](https://github.com/datapartyjs/dataparty-crypto/blob/master/examples/example-password-argon2.js) | ||
* `pbkdf2` - [See example](https://github.com/datapartyjs/dataparty-crypto/blob/master/examples/example-password-pbkdf2.js) - [warning outdate](https://medium.com/@alanmeekins/wtf-is-a-kdf-a267bda53e8f) | ||
* Mnemonic derived keys seed phrases - [See example](https://github.com/datapartyjs/dataparty-crypto/blob/master/examples/example-seed-phrase.js) | ||
* bip39 - Phrases are generated using [bip39](https://github.com/bitcoinjs/bip39). | ||
@@ -91,2 +94,23 @@ | ||
#### Password key derivation | ||
``` | ||
const password = 'super-strong-password' | ||
const salt = await dataparty_crypto.Routines.generateSalt() //! Salt would be read from disk after 1st run | ||
const key = await dataparty_crypto.Routines.createKeyFromPasswordArgon2( | ||
argon2, | ||
"supersecretpassword123", | ||
salt | ||
) | ||
``` | ||
#### Mnemonic derived keys seed phrases | ||
``` | ||
const phrase = await dataparty_crypto.Routines.generateMnemonic() | ||
let key = await dataparty_crypto.Routines.createKeyFromMnemonic(phrase) | ||
``` | ||
# Developing | ||
@@ -98,1 +122,6 @@ | ||
# Support | ||
Buy us a coffee! | ||
* [ko-fi/dataparty](https://ko-fi.com/dataparty) |
Sorry, the diff of this file is too big to display
4670414
125