Repository navigation
Commit befead5
committed
create: Stretch typed keystrokes with scrypt
People type far fewer unpredictable bits than they think, so when both
generators fail and Core's wallet file leaks, raw typed keys can be
guessed quickly. Each draw now runs the typed text through scrypt at
OWASP's minimum (N=2^17, r=8, p=1, 128 MiB, maxmem capped at 256 MiB)
before hashing it in, salted with a domain tag and the draw's first
xprv and OS bytes. It adds no entropy, but every guess now costs one
scrypt. Draws without typed keys skip scrypt and are unchanged.
A 3-of-5 creation makes 9 draws, so about 10 seconds in all.
Claude-Session: https://claude.ai/code/session_01T233rKgZqE5wzDm3EVTHL11 parent fc64ea2 commit befead5
4 files changed
Lines changed: 36 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
668 | 670 | | |
669 | 671 | | |
670 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
487 | 495 | | |
488 | 496 | | |
489 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
| 906 | + | |
906 | 907 | | |
907 | | - | |
| 908 | + | |
908 | 909 | | |
909 | | - | |
| 910 | + | |
910 | 911 | | |
911 | | - | |
| 912 | + | |
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | 916 | | |
916 | 917 | | |
917 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
918 | 925 | | |
919 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
920 | 934 | | |
921 | | - | |
922 | | - | |
| 935 | + | |
| 936 | + | |
923 | 937 | | |
924 | 938 | | |
| 939 | + | |
925 | 940 | | |
926 | 941 | | |
927 | 942 | | |
| |||
0 commit comments