Repository navigation
Conversation
Monero normalizes the passphrase to NFKD and keeps at most 575 bytes before the KDF. crypt() was hashing the raw UTF-8, so a passphrase like contraseña encrypted a seed that Monero restores as a different wallet.
Author
|
@OmarHatem28 polyseed passphrases are normalized with NFKD in this one. Open since Nov 9 with no review. Could you look? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
crypt()hashed the passphrase as raw UTF-8. Monero normalizes it to NFKD first, and keeps at most 575 bytes, before the same KDF. A passphrase that NFKD changes, such ascontraseña, encrypts a seed thatmonero-wallet-clirestores as a different empty wallet. Polyseed has no MAC, so the restore does not fail.ASCII passphrases are unchanged, including the existing C-suite vector for
password. An all-ASCII passphrase longer than 575 bytes now uses the first 575 bytes. A non-ASCII passphrase whose NFKD form does not fit in 575 bytes is rejected, which is what Monero does.This is cake-tech/cake_wallet#3722. Cake pins
polyseedat1a8280ac2b6f01d202d8bff71527fe1ce498c4edinpubspec_overrides.yaml, so the wallet picks this up when that ref moves to the merge commit. Version is 0.0.8.Test plan
dart test(84 passed, 7 skipped, the skips were already there)test/polyseed_password_test.dartfailed on trunk before this change:contraseña,비밀번호,パスワード, andpässwördnow encrypt the same phrase as their NFKD formñcharacters, whose NFKD form is longer than 575 bytes, throwsPasswordTooLongException