* Allow keypair generation from input string * Add keyfile encryption/decryption * Pass secret through n rounds * Split definition types * Additional cleanups * Pass salt as blake2b input * Move kdf hashing to util-cypto * Dangling comma * Pull through secret as string | Uint8Array * Update documentation
705 B
705 B
kdf
Create Keys for use in encryption (rounds & salt) based on inputs
- kdfAsU8a Create Uint8Array key based on inputs
kdfAsU8a
Create Uint8Array key based on inputs
kdfAsU8a (secret: Uint8Array | string, rounds?: number, salt?: Uint8Array): { key: Uint8Array, rounds: number, salt: Uint8Array }
From either a string or a Uint8Array input, create a key with an optional (or random) salt based on the number of rounds with Blake2. Return return the result key as a Uint8Array in addition to the salt used and rounds employed.
import { kdfAsU8a } from '@polkadot/util-crypto';
kdfAsU8a('123') // => { key: Uint8Array, rounds: number, salt: Uint8Array }