Extend `KeyProvider` to accept arbitrary length pass-phrases
Closed this issue · 0 comments
felsweg-iota commented
Description
KeyProvider
currently supports only keys of a certain length. Prior implementation truncated the provided passphrases to a certain length. This features request shall extend KeyProvider
to have two more construction functions, that
- create a
KeyProvider
with a passphrase of arbitrary length, which is truncated internally and shall have following signaturewith_passphrase_truncated<P>(passphrase : P) -> Result<Self, ClientError> where P : AsRef<[u8]> + Zeroize
- create a
KeyProvider
with a passphrase of arbitrary length, which is hashed with a cryptographically secure hash function and shall have the following signaturewith_passphrase_hashed<P,D>(passphrase : P, digest : D) -> Result<Self, ClientError> where P : AsRef<[u8]> + Zeroize, D: Digest
- create a
KeyProvider
with a passphrase of arbitrary length, which is hashed with blake2b function and shall have the following signaturewith_passphrase_hashed_blake2b<P,D>(passphrase : P) -> Result<Self, ClientError> where P : AsRef<[u8]> + Zeroize, D: Digest
Motivation
Passphrases should not be restricted in size, and Stronghold should make sure to enforce strong passphrase security by applying strong cryptographic functions.
Requirements
- This feature only enhances the current
KeyProvider
behavior
Are you planning to do it yourself in a pull request?
Yes