lighthouse/crypto
Kirk Baird 3db9072fee Reject invalid utf-8 characters during encryption (#1928)
## Issue Addressed

Closes #1889 

## Proposed Changes

- Error when passwords which use invalid UTF-8 characters during encryption. 
- Add some tests

## Additional Info

I've decided to error when bad characters are used to create/encrypt a keystore but think we should allow them during decryption since either the keystore was created
-  with invalid UTF-8 characters (possibly by another client or someone whose password is random bytes) in which case we'd want them to be able to decrypt their keystore using the right key.
-  without invalid characters then the password checksum would almost certainly fail.

Happy to add them to decryption if we want to make the decryption more trigger happy 😋 , it would only be a one line change and would tell the user which character index is causing the issue.

See https://eips.ethereum.org/EIPS/eip-2335#password-requirements
2020-11-19 00:37:43 +00:00
..
bls Update to spec v1.0.0-rc.0 and BLSv4 (#1765) 2020-10-28 22:19:38 +00:00
eth2_hashing Update external deps (#1711) 2020-10-05 08:22:19 +00:00
eth2_key_derivation Update external deps (#1711) 2020-10-05 08:22:19 +00:00
eth2_keystore Reject invalid utf-8 characters during encryption (#1928) 2020-11-19 00:37:43 +00:00
eth2_wallet Update tiny-bip39 dependency (#1887) 2020-11-12 00:46:33 +00:00