told_mnemonic.py - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
told_mnemonic.py (17857B)
---
1 #!/usr/bin/env python
2 #
3 # Electrum - lightweight Bitcoin client
4 # Copyright (C) 2011 thomasv@gitorious
5 #
6 # Permission is hereby granted, free of charge, to any person
7 # obtaining a copy of this software and associated documentation files
8 # (the "Software"), to deal in the Software without restriction,
9 # including without limitation the rights to use, copy, modify, merge,
10 # publish, distribute, sublicense, and/or sell copies of the Software,
11 # and to permit persons to whom the Software is furnished to do so,
12 # subject to the following conditions:
13 #
14 # The above copyright notice and this permission notice shall be
15 # included in all copies or substantial portions of the Software.
16 #
17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 # SOFTWARE.
25
26 from .mnemonic import Wordlist
27
28
29 # list of words from http://en.wiktionary.org/wiki/Wiktionary:Frequency_lists/Contemporary_poetry
30
31 _words = (
32 "like",
33 "just",
34 "love",
35 "know",
36 "never",
37 "want",
38 "time",
39 "out",
40 "there",
41 "make",
42 "look",
43 "eye",
44 "down",
45 "only",
46 "think",
47 "heart",
48 "back",
49 "then",
50 "into",
51 "about",
52 "more",
53 "away",
54 "still",
55 "them",
56 "take",
57 "thing",
58 "even",
59 "through",
60 "long",
61 "always",
62 "world",
63 "too",
64 "friend",
65 "tell",
66 "try",
67 "hand",
68 "thought",
69 "over",
70 "here",
71 "other",
72 "need",
73 "smile",
74 "again",
75 "much",
76 "cry",
77 "been",
78 "night",
79 "ever",
80 "little",
81 "said",
82 "end",
83 "some",
84 "those",
85 "around",
86 "mind",
87 "people",
88 "girl",
89 "leave",
90 "dream",
91 "left",
92 "turn",
93 "myself",
94 "give",
95 "nothing",
96 "really",
97 "off",
98 "before",
99 "something",
100 "find",
101 "walk",
102 "wish",
103 "good",
104 "once",
105 "place",
106 "ask",
107 "stop",
108 "keep",
109 "watch",
110 "seem",
111 "everything",
112 "wait",
113 "got",
114 "yet",
115 "made",
116 "remember",
117 "start",
118 "alone",
119 "run",
120 "hope",
121 "maybe",
122 "believe",
123 "body",
124 "hate",
125 "after",
126 "close",
127 "talk",
128 "stand",
129 "own",
130 "each",
131 "hurt",
132 "help",
133 "home",
134 "god",
135 "soul",
136 "new",
137 "many",
138 "two",
139 "inside",
140 "should",
141 "true",
142 "first",
143 "fear",
144 "mean",
145 "better",
146 "play",
147 "another",
148 "gone",
149 "change",
150 "use",
151 "wonder",
152 "someone",
153 "hair",
154 "cold",
155 "open",
156 "best",
157 "any",
158 "behind",
159 "happen",
160 "water",
161 "dark",
162 "laugh",
163 "stay",
164 "forever",
165 "name",
166 "work",
167 "show",
168 "sky",
169 "break",
170 "came",
171 "deep",
172 "door",
173 "put",
174 "black",
175 "together",
176 "upon",
177 "happy",
178 "such",
179 "great",
180 "white",
181 "matter",
182 "fill",
183 "past",
184 "please",
185 "burn",
186 "cause",
187 "enough",
188 "touch",
189 "moment",
190 "soon",
191 "voice",
192 "scream",
193 "anything",
194 "stare",
195 "sound",
196 "red",
197 "everyone",
198 "hide",
199 "kiss",
200 "truth",
201 "death",
202 "beautiful",
203 "mine",
204 "blood",
205 "broken",
206 "very",
207 "pass",
208 "next",
209 "forget",
210 "tree",
211 "wrong",
212 "air",
213 "mother",
214 "understand",
215 "lip",
216 "hit",
217 "wall",
218 "memory",
219 "sleep",
220 "free",
221 "high",
222 "realize",
223 "school",
224 "might",
225 "skin",
226 "sweet",
227 "perfect",
228 "blue",
229 "kill",
230 "breath",
231 "dance",
232 "against",
233 "fly",
234 "between",
235 "grow",
236 "strong",
237 "under",
238 "listen",
239 "bring",
240 "sometimes",
241 "speak",
242 "pull",
243 "person",
244 "become",
245 "family",
246 "begin",
247 "ground",
248 "real",
249 "small",
250 "father",
251 "sure",
252 "feet",
253 "rest",
254 "young",
255 "finally",
256 "land",
257 "across",
258 "today",
259 "different",
260 "guy",
261 "line",
262 "fire",
263 "reason",
264 "reach",
265 "second",
266 "slowly",
267 "write",
268 "eat",
269 "smell",
270 "mouth",
271 "step",
272 "learn",
273 "three",
274 "floor",
275 "promise",
276 "breathe",
277 "darkness",
278 "push",
279 "earth",
280 "guess",
281 "save",
282 "song",
283 "above",
284 "along",
285 "both",
286 "color",
287 "house",
288 "almost",
289 "sorry",
290 "anymore",
291 "brother",
292 "okay",
293 "dear",
294 "game",
295 "fade",
296 "already",
297 "apart",
298 "warm",
299 "beauty",
300 "heard",
301 "notice",
302 "question",
303 "shine",
304 "began",
305 "piece",
306 "whole",
307 "shadow",
308 "secret",
309 "street",
310 "within",
311 "finger",
312 "point",
313 "morning",
314 "whisper",
315 "child",
316 "moon",
317 "green",
318 "story",
319 "glass",
320 "kid",
321 "silence",
322 "since",
323 "soft",
324 "yourself",
325 "empty",
326 "shall",
327 "angel",
328 "answer",
329 "baby",
330 "bright",
331 "dad",
332 "path",
333 "worry",
334 "hour",
335 "drop",
336 "follow",
337 "power",
338 "war",
339 "half",
340 "flow",
341 "heaven",
342 "act",
343 "chance",
344 "fact",
345 "least",
346 "tired",
347 "children",
348 "near",
349 "quite",
350 "afraid",
351 "rise",
352 "sea",
353 "taste",
354 "window",
355 "cover",
356 "nice",
357 "trust",
358 "lot",
359 "sad",
360 "cool",
361 "force",
362 "peace",
363 "return",
364 "blind",
365 "easy",
366 "ready",
367 "roll",
368 "rose",
369 "drive",
370 "held",
371 "music",
372 "beneath",
373 "hang",
374 "mom",
375 "paint",
376 "emotion",
377 "quiet",
378 "clear",
379 "cloud",
380 "few",
381 "pretty",
382 "bird",
383 "outside",
384 "paper",
385 "picture",
386 "front",
387 "rock",
388 "simple",
389 "anyone",
390 "meant",
391 "reality",
392 "road",
393 "sense",
394 "waste",
395 "bit",
396 "leaf",
397 "thank",
398 "happiness",
399 "meet",
400 "men",
401 "smoke",
402 "truly",
403 "decide",
404 "self",
405 "age",
406 "book",
407 "form",
408 "alive",
409 "carry",
410 "escape",
411 "damn",
412 "instead",
413 "able",
414 "ice",
415 "minute",
416 "throw",
417 "catch",
418 "leg",
419 "ring",
420 "course",
421 "goodbye",
422 "lead",
423 "poem",
424 "sick",
425 "corner",
426 "desire",
427 "known",
428 "problem",
429 "remind",
430 "shoulder",
431 "suppose",
432 "toward",
433 "wave",
434 "drink",
435 "jump",
436 "woman",
437 "pretend",
438 "sister",
439 "week",
440 "human",
441 "joy",
442 "crack",
443 "grey",
444 "pray",
445 "surprise",
446 "dry",
447 "knee",
448 "less",
449 "search",
450 "bleed",
451 "caught",
452 "clean",
453 "embrace",
454 "future",
455 "king",
456 "son",
457 "sorrow",
458 "chest",
459 "hug",
460 "remain",
461 "sat",
462 "worth",
463 "blow",
464 "daddy",
465 "final",
466 "parent",
467 "tight",
468 "also",
469 "create",
470 "lonely",
471 "safe",
472 "cross",
473 "dress",
474 "evil",
475 "silent",
476 "bone",
477 "fate",
478 "perhaps",
479 "anger",
480 "class",
481 "scar",
482 "snow",
483 "tiny",
484 "tonight",
485 "continue",
486 "control",
487 "dog",
488 "edge",
489 "mirror",
490 "month",
491 "suddenly",
492 "comfort",
493 "given",
494 "loud",
495 "quickly",
496 "gaze",
497 "plan",
498 "rush",
499 "stone",
500 "town",
501 "battle",
502 "ignore",
503 "spirit",
504 "stood",
505 "stupid",
506 "yours",
507 "brown",
508 "build",
509 "dust",
510 "hey",
511 "kept",
512 "pay",
513 "phone",
514 "twist",
515 "although",
516 "ball",
517 "beyond",
518 "hidden",
519 "nose",
520 "taken",
521 "fail",
522 "float",
523 "pure",
524 "somehow",
525 "wash",
526 "wrap",
527 "angry",
528 "cheek",
529 "creature",
530 "forgotten",
531 "heat",
532 "rip",
533 "single",
534 "space",
535 "special",
536 "weak",
537 "whatever",
538 "yell",
539 "anyway",
540 "blame",
541 "job",
542 "choose",
543 "country",
544 "curse",
545 "drift",
546 "echo",
547 "figure",
548 "grew",
549 "laughter",
550 "neck",
551 "suffer",
552 "worse",
553 "yeah",
554 "disappear",
555 "foot",
556 "forward",
557 "knife",
558 "mess",
559 "somewhere",
560 "stomach",
561 "storm",
562 "beg",
563 "idea",
564 "lift",
565 "offer",
566 "breeze",
567 "field",
568 "five",
569 "often",
570 "simply",
571 "stuck",
572 "win",
573 "allow",
574 "confuse",
575 "enjoy",
576 "except",
577 "flower",
578 "seek",
579 "strength",
580 "calm",
581 "grin",
582 "gun",
583 "heavy",
584 "hill",
585 "large",
586 "ocean",
587 "shoe",
588 "sigh",
589 "straight",
590 "summer",
591 "tongue",
592 "accept",
593 "crazy",
594 "everyday",
595 "exist",
596 "grass",
597 "mistake",
598 "sent",
599 "shut",
600 "surround",
601 "table",
602 "ache",
603 "brain",
604 "destroy",
605 "heal",
606 "nature",
607 "shout",
608 "sign",
609 "stain",
610 "choice",
611 "doubt",
612 "glance",
613 "glow",
614 "mountain",
615 "queen",
616 "stranger",
617 "throat",
618 "tomorrow",
619 "city",
620 "either",
621 "fish",
622 "flame",
623 "rather",
624 "shape",
625 "spin",
626 "spread",
627 "ash",
628 "distance",
629 "finish",
630 "image",
631 "imagine",
632 "important",
633 "nobody",
634 "shatter",
635 "warmth",
636 "became",
637 "feed",
638 "flesh",
639 "funny",
640 "lust",
641 "shirt",
642 "trouble",
643 "yellow",
644 "attention",
645 "bare",
646 "bite",
647 "money",
648 "protect",
649 "amaze",
650 "appear",
651 "born",
652 "choke",
653 "completely",
654 "daughter",
655 "fresh",
656 "friendship",
657 "gentle",
658 "probably",
659 "six",
660 "deserve",
661 "expect",
662 "grab",
663 "middle",
664 "nightmare",
665 "river",
666 "thousand",
667 "weight",
668 "worst",
669 "wound",
670 "barely",
671 "bottle",
672 "cream",
673 "regret",
674 "relationship",
675 "stick",
676 "test",
677 "crush",
678 "endless",
679 "fault",
680 "itself",
681 "rule",
682 "spill",
683 "art",
684 "circle",
685 "join",
686 "kick",
687 "mask",
688 "master",
689 "passion",
690 "quick",
691 "raise",
692 "smooth",
693 "unless",
694 "wander",
695 "actually",
696 "broke",
697 "chair",
698 "deal",
699 "favorite",
700 "gift",
701 "note",
702 "number",
703 "sweat",
704 "box",
705 "chill",
706 "clothes",
707 "lady",
708 "mark",
709 "park",
710 "poor",
711 "sadness",
712 "tie",
713 "animal",
714 "belong",
715 "brush",
716 "consume",
717 "dawn",
718 "forest",
719 "innocent",
720 "pen",
721 "pride",
722 "stream",
723 "thick",
724 "clay",
725 "complete",
726 "count",
727 "draw",
728 "faith",
729 "press",
730 "silver",
731 "struggle",
732 "surface",
733 "taught",
734 "teach",
735 "wet",
736 "bless",
737 "chase",
738 "climb",
739 "enter",
740 "letter",
741 "melt",
742 "metal",
743 "movie",
744 "stretch",
745 "swing",
746 "vision",
747 "wife",
748 "beside",
749 "crash",
750 "forgot",
751 "guide",
752 "haunt",
753 "joke",
754 "knock",
755 "plant",
756 "pour",
757 "prove",
758 "reveal",
759 "steal",
760 "stuff",
761 "trip",
762 "wood",
763 "wrist",
764 "bother",
765 "bottom",
766 "crawl",
767 "crowd",
768 "fix",
769 "forgive",
770 "frown",
771 "grace",
772 "loose",
773 "lucky",
774 "party",
775 "release",
776 "surely",
777 "survive",
778 "teacher",
779 "gently",
780 "grip",
781 "speed",
782 "suicide",
783 "travel",
784 "treat",
785 "vein",
786 "written",
787 "cage",
788 "chain",
789 "conversation",
790 "date",
791 "enemy",
792 "however",
793 "interest",
794 "million",
795 "page",
796 "pink",
797 "proud",
798 "sway",
799 "themselves",
800 "winter",
801 "church",
802 "cruel",
803 "cup",
804 "demon",
805 "experience",
806 "freedom",
807 "pair",
808 "pop",
809 "purpose",
810 "respect",
811 "shoot",
812 "softly",
813 "state",
814 "strange",
815 "bar",
816 "birth",
817 "curl",
818 "dirt",
819 "excuse",
820 "lord",
821 "lovely",
822 "monster",
823 "order",
824 "pack",
825 "pants",
826 "pool",
827 "scene",
828 "seven",
829 "shame",
830 "slide",
831 "ugly",
832 "among",
833 "blade",
834 "blonde",
835 "closet",
836 "creek",
837 "deny",
838 "drug",
839 "eternity",
840 "gain",
841 "grade",
842 "handle",
843 "key",
844 "linger",
845 "pale",
846 "prepare",
847 "swallow",
848 "swim",
849 "tremble",
850 "wheel",
851 "won",
852 "cast",
853 "cigarette",
854 "claim",
855 "college",
856 "direction",
857 "dirty",
858 "gather",
859 "ghost",
860 "hundred",
861 "loss",
862 "lung",
863 "orange",
864 "present",
865 "swear",
866 "swirl",
867 "twice",
868 "wild",
869 "bitter",
870 "blanket",
871 "doctor",
872 "everywhere",
873 "flash",
874 "grown",
875 "knowledge",
876 "numb",
877 "pressure",
878 "radio",
879 "repeat",
880 "ruin",
881 "spend",
882 "unknown",
883 "buy",
884 "clock",
885 "devil",
886 "early",
887 "false",
888 "fantasy",
889 "pound",
890 "precious",
891 "refuse",
892 "sheet",
893 "teeth",
894 "welcome",
895 "add",
896 "ahead",
897 "block",
898 "bury",
899 "caress",
900 "content",
901 "depth",
902 "despite",
903 "distant",
904 "marry",
905 "purple",
906 "threw",
907 "whenever",
908 "bomb",
909 "dull",
910 "easily",
911 "grasp",
912 "hospital",
913 "innocence",
914 "normal",
915 "receive",
916 "reply",
917 "rhyme",
918 "shade",
919 "someday",
920 "sword",
921 "toe",
922 "visit",
923 "asleep",
924 "bought",
925 "center",
926 "consider",
927 "flat",
928 "hero",
929 "history",
930 "ink",
931 "insane",
932 "muscle",
933 "mystery",
934 "pocket",
935 "reflection",
936 "shove",
937 "silently",
938 "smart",
939 "soldier",
940 "spot",
941 "stress",
942 "train",
943 "type",
944 "view",
945 "whether",
946 "bus",
947 "energy",
948 "explain",
949 "holy",
950 "hunger",
951 "inch",
952 "magic",
953 "mix",
954 "noise",
955 "nowhere",
956 "prayer",
957 "presence",
958 "shock",
959 "snap",
960 "spider",
961 "study",
962 "thunder",
963 "trail",
964 "admit",
965 "agree",
966 "bag",
967 "bang",
968 "bound",
969 "butterfly",
970 "cute",
971 "exactly",
972 "explode",
973 "familiar",
974 "fold",
975 "further",
976 "pierce",
977 "reflect",
978 "scent",
979 "selfish",
980 "sharp",
981 "sink",
982 "spring",
983 "stumble",
984 "universe",
985 "weep",
986 "women",
987 "wonderful",
988 "action",
989 "ancient",
990 "attempt",
991 "avoid",
992 "birthday",
993 "branch",
994 "chocolate",
995 "core",
996 "depress",
997 "drunk",
998 "especially",
999 "focus",
1000 "fruit",
1001 "honest",
1002 "match",
1003 "palm",
1004 "perfectly",
1005 "pillow",
1006 "pity",
1007 "poison",
1008 "roar",
1009 "shift",
1010 "slightly",
1011 "thump",
1012 "truck",
1013 "tune",
1014 "twenty",
1015 "unable",
1016 "wipe",
1017 "wrote",
1018 "coat",
1019 "constant",
1020 "dinner",
1021 "drove",
1022 "egg",
1023 "eternal",
1024 "flight",
1025 "flood",
1026 "frame",
1027 "freak",
1028 "gasp",
1029 "glad",
1030 "hollow",
1031 "motion",
1032 "peer",
1033 "plastic",
1034 "root",
1035 "screen",
1036 "season",
1037 "sting",
1038 "strike",
1039 "team",
1040 "unlike",
1041 "victim",
1042 "volume",
1043 "warn",
1044 "weird",
1045 "attack",
1046 "await",
1047 "awake",
1048 "built",
1049 "charm",
1050 "crave",
1051 "despair",
1052 "fought",
1053 "grant",
1054 "grief",
1055 "horse",
1056 "limit",
1057 "message",
1058 "ripple",
1059 "sanity",
1060 "scatter",
1061 "serve",
1062 "split",
1063 "string",
1064 "trick",
1065 "annoy",
1066 "blur",
1067 "boat",
1068 "brave",
1069 "clearly",
1070 "cling",
1071 "connect",
1072 "fist",
1073 "forth",
1074 "imagination",
1075 "iron",
1076 "jock",
1077 "judge",
1078 "lesson",
1079 "milk",
1080 "misery",
1081 "nail",
1082 "naked",
1083 "ourselves",
1084 "poet",
1085 "possible",
1086 "princess",
1087 "sail",
1088 "size",
1089 "snake",
1090 "society",
1091 "stroke",
1092 "torture",
1093 "toss",
1094 "trace",
1095 "wise",
1096 "bloom",
1097 "bullet",
1098 "cell",
1099 "check",
1100 "cost",
1101 "darling",
1102 "during",
1103 "footstep",
1104 "fragile",
1105 "hallway",
1106 "hardly",
1107 "horizon",
1108 "invisible",
1109 "journey",
1110 "midnight",
1111 "mud",
1112 "nod",
1113 "pause",
1114 "relax",
1115 "shiver",
1116 "sudden",
1117 "value",
1118 "youth",
1119 "abuse",
1120 "admire",
1121 "blink",
1122 "breast",
1123 "bruise",
1124 "constantly",
1125 "couple",
1126 "creep",
1127 "curve",
1128 "difference",
1129 "dumb",
1130 "emptiness",
1131 "gotta",
1132 "honor",
1133 "plain",
1134 "planet",
1135 "recall",
1136 "rub",
1137 "ship",
1138 "slam",
1139 "soar",
1140 "somebody",
1141 "tightly",
1142 "weather",
1143 "adore",
1144 "approach",
1145 "bond",
1146 "bread",
1147 "burst",
1148 "candle",
1149 "coffee",
1150 "cousin",
1151 "crime",
1152 "desert",
1153 "flutter",
1154 "frozen",
1155 "grand",
1156 "heel",
1157 "hello",
1158 "language",
1159 "level",
1160 "movement",
1161 "pleasure",
1162 "powerful",
1163 "random",
1164 "rhythm",
1165 "settle",
1166 "silly",
1167 "slap",
1168 "sort",
1169 "spoken",
1170 "steel",
1171 "threaten",
1172 "tumble",
1173 "upset",
1174 "aside",
1175 "awkward",
1176 "bee",
1177 "blank",
1178 "board",
1179 "button",
1180 "card",
1181 "carefully",
1182 "complain",
1183 "crap",
1184 "deeply",
1185 "discover",
1186 "drag",
1187 "dread",
1188 "effort",
1189 "entire",
1190 "fairy",
1191 "giant",
1192 "gotten",
1193 "greet",
1194 "illusion",
1195 "jeans",
1196 "leap",
1197 "liquid",
1198 "march",
1199 "mend",
1200 "nervous",
1201 "nine",
1202 "replace",
1203 "rope",
1204 "spine",
1205 "stole",
1206 "terror",
1207 "accident",
1208 "apple",
1209 "balance",
1210 "boom",
1211 "childhood",
1212 "collect",
1213 "demand",
1214 "depression",
1215 "eventually",
1216 "faint",
1217 "glare",
1218 "goal",
1219 "group",
1220 "honey",
1221 "kitchen",
1222 "laid",
1223 "limb",
1224 "machine",
1225 "mere",
1226 "mold",
1227 "murder",
1228 "nerve",
1229 "painful",
1230 "poetry",
1231 "prince",
1232 "rabbit",
1233 "shelter",
1234 "shore",
1235 "shower",
1236 "soothe",
1237 "stair",
1238 "steady",
1239 "sunlight",
1240 "tangle",
1241 "tease",
1242 "treasure",
1243 "uncle",
1244 "begun",
1245 "bliss",
1246 "canvas",
1247 "cheer",
1248 "claw",
1249 "clutch",
1250 "commit",
1251 "crimson",
1252 "crystal",
1253 "delight",
1254 "doll",
1255 "existence",
1256 "express",
1257 "fog",
1258 "football",
1259 "gay",
1260 "goose",
1261 "guard",
1262 "hatred",
1263 "illuminate",
1264 "mass",
1265 "math",
1266 "mourn",
1267 "rich",
1268 "rough",
1269 "skip",
1270 "stir",
1271 "student",
1272 "style",
1273 "support",
1274 "thorn",
1275 "tough",
1276 "yard",
1277 "yearn",
1278 "yesterday",
1279 "advice",
1280 "appreciate",
1281 "autumn",
1282 "bank",
1283 "beam",
1284 "bowl",
1285 "capture",
1286 "carve",
1287 "collapse",
1288 "confusion",
1289 "creation",
1290 "dove",
1291 "feather",
1292 "girlfriend",
1293 "glory",
1294 "government",
1295 "harsh",
1296 "hop",
1297 "inner",
1298 "loser",
1299 "moonlight",
1300 "neighbor",
1301 "neither",
1302 "peach",
1303 "pig",
1304 "praise",
1305 "screw",
1306 "shield",
1307 "shimmer",
1308 "sneak",
1309 "stab",
1310 "subject",
1311 "throughout",
1312 "thrown",
1313 "tower",
1314 "twirl",
1315 "wow",
1316 "army",
1317 "arrive",
1318 "bathroom",
1319 "bump",
1320 "cease",
1321 "cookie",
1322 "couch",
1323 "courage",
1324 "dim",
1325 "guilt",
1326 "howl",
1327 "hum",
1328 "husband",
1329 "insult",
1330 "led",
1331 "lunch",
1332 "mock",
1333 "mostly",
1334 "natural",
1335 "nearly",
1336 "needle",
1337 "nerd",
1338 "peaceful",
1339 "perfection",
1340 "pile",
1341 "price",
1342 "remove",
1343 "roam",
1344 "sanctuary",
1345 "serious",
1346 "shiny",
1347 "shook",
1348 "sob",
1349 "stolen",
1350 "tap",
1351 "vain",
1352 "void",
1353 "warrior",
1354 "wrinkle",
1355 "affection",
1356 "apologize",
1357 "blossom",
1358 "bounce",
1359 "bridge",
1360 "cheap",
1361 "crumble",
1362 "decision",
1363 "descend",
1364 "desperately",
1365 "dig",
1366 "dot",
1367 "flip",
1368 "frighten",
1369 "heartbeat",
1370 "huge",
1371 "lazy",
1372 "lick",
1373 "odd",
1374 "opinion",
1375 "process",
1376 "puzzle",
1377 "quietly",
1378 "retreat",
1379 "score",
1380 "sentence",
1381 "separate",
1382 "situation",
1383 "skill",
1384 "soak",
1385 "square",
1386 "stray",
1387 "taint",
1388 "task",
1389 "tide",
1390 "underneath",
1391 "veil",
1392 "whistle",
1393 "anywhere",
1394 "bedroom",
1395 "bid",
1396 "bloody",
1397 "burden",
1398 "careful",
1399 "compare",
1400 "concern",
1401 "curtain",
1402 "decay",
1403 "defeat",
1404 "describe",
1405 "double",
1406 "dreamer",
1407 "driver",
1408 "dwell",
1409 "evening",
1410 "flare",
1411 "flicker",
1412 "grandma",
1413 "guitar",
1414 "harm",
1415 "horrible",
1416 "hungry",
1417 "indeed",
1418 "lace",
1419 "melody",
1420 "monkey",
1421 "nation",
1422 "object",
1423 "obviously",
1424 "rainbow",
1425 "salt",
1426 "scratch",
1427 "shown",
1428 "shy",
1429 "stage",
1430 "stun",
1431 "third",
1432 "tickle",
1433 "useless",
1434 "weakness",
1435 "worship",
1436 "worthless",
1437 "afternoon",
1438 "beard",
1439 "boyfriend",
1440 "bubble",
1441 "busy",
1442 "certain",
1443 "chin",
1444 "concrete",
1445 "desk",
1446 "diamond",
1447 "doom",
1448 "drawn",
1449 "due",
1450 "felicity",
1451 "freeze",
1452 "frost",
1453 "garden",
1454 "glide",
1455 "harmony",
1456 "hopefully",
1457 "hunt",
1458 "jealous",
1459 "lightning",
1460 "mama",
1461 "mercy",
1462 "peel",
1463 "physical",
1464 "position",
1465 "pulse",
1466 "punch",
1467 "quit",
1468 "rant",
1469 "respond",
1470 "salty",
1471 "sane",
1472 "satisfy",
1473 "savior",
1474 "sheep",
1475 "slept",
1476 "social",
1477 "sport",
1478 "tuck",
1479 "utter",
1480 "valley",
1481 "wolf",
1482 "aim",
1483 "alas",
1484 "alter",
1485 "arrow",
1486 "awaken",
1487 "beaten",
1488 "belief",
1489 "brand",
1490 "ceiling",
1491 "cheese",
1492 "clue",
1493 "confidence",
1494 "connection",
1495 "daily",
1496 "disguise",
1497 "eager",
1498 "erase",
1499 "essence",
1500 "everytime",
1501 "expression",
1502 "fan",
1503 "flag",
1504 "flirt",
1505 "foul",
1506 "fur",
1507 "giggle",
1508 "glorious",
1509 "ignorance",
1510 "law",
1511 "lifeless",
1512 "measure",
1513 "mighty",
1514 "muse",
1515 "north",
1516 "opposite",
1517 "paradise",
1518 "patience",
1519 "patient",
1520 "pencil",
1521 "petal",
1522 "plate",
1523 "ponder",
1524 "possibly",
1525 "practice",
1526 "slice",
1527 "spell",
1528 "stock",
1529 "strife",
1530 "strip",
1531 "suffocate",
1532 "suit",
1533 "tender",
1534 "tool",
1535 "trade",
1536 "velvet",
1537 "verse",
1538 "waist",
1539 "witch",
1540 "aunt",
1541 "bench",
1542 "bold",
1543 "cap",
1544 "certainly",
1545 "click",
1546 "companion",
1547 "creator",
1548 "dart",
1549 "delicate",
1550 "determine",
1551 "dish",
1552 "dragon",
1553 "drama",
1554 "drum",
1555 "dude",
1556 "everybody",
1557 "feast",
1558 "forehead",
1559 "former",
1560 "fright",
1561 "fully",
1562 "gas",
1563 "hook",
1564 "hurl",
1565 "invite",
1566 "juice",
1567 "manage",
1568 "moral",
1569 "possess",
1570 "raw",
1571 "rebel",
1572 "royal",
1573 "scale",
1574 "scary",
1575 "several",
1576 "slight",
1577 "stubborn",
1578 "swell",
1579 "talent",
1580 "tea",
1581 "terrible",
1582 "thread",
1583 "torment",
1584 "trickle",
1585 "usually",
1586 "vast",
1587 "violence",
1588 "weave",
1589 "acid",
1590 "agony",
1591 "ashamed",
1592 "awe",
1593 "belly",
1594 "blend",
1595 "blush",
1596 "character",
1597 "cheat",
1598 "common",
1599 "company",
1600 "coward",
1601 "creak",
1602 "danger",
1603 "deadly",
1604 "defense",
1605 "define",
1606 "depend",
1607 "desperate",
1608 "destination",
1609 "dew",
1610 "duck",
1611 "dusty",
1612 "embarrass",
1613 "engine",
1614 "example",
1615 "explore",
1616 "foe",
1617 "freely",
1618 "frustrate",
1619 "generation",
1620 "glove",
1621 "guilty",
1622 "health",
1623 "hurry",
1624 "idiot",
1625 "impossible",
1626 "inhale",
1627 "jaw",
1628 "kingdom",
1629 "mention",
1630 "mist",
1631 "moan",
1632 "mumble",
1633 "mutter",
1634 "observe",
1635 "ode",
1636 "pathetic",
1637 "pattern",
1638 "pie",
1639 "prefer",
1640 "puff",
1641 "rape",
1642 "rare",
1643 "revenge",
1644 "rude",
1645 "scrape",
1646 "spiral",
1647 "squeeze",
1648 "strain",
1649 "sunset",
1650 "suspend",
1651 "sympathy",
1652 "thigh",
1653 "throne",
1654 "total",
1655 "unseen",
1656 "weapon",
1657 "weary",
1658 )
1659
1660 wordlist = Wordlist(_words)
1661
1662 n = len(wordlist)
1663 assert n == 1626
1664
1665
1666 # Note about US patent no 5892470: Here each word does not represent a given digit.
1667 # Instead, the digit represented by a word is variable, it depends on the previous word.
1668
1669 def mn_encode( message ):
1670 assert len(message) % 8 == 0
1671 out = []
1672 for i in range(len(message)//8):
1673 word = message[8*i:8*i+8]
1674 x = int(word, 16)
1675 w1 = (x%n)
1676 w2 = ((x//n) + w1)%n
1677 w3 = ((x//n//n) + w2)%n
1678 out += [ wordlist[w1], wordlist[w2], wordlist[w3] ]
1679 return out
1680
1681
1682 def mn_decode( wlist ):
1683 out = ''
1684 for i in range(len(wlist)//3):
1685 word1, word2, word3 = wlist[3*i:3*i+3]
1686 w1 = wordlist.index(word1)
1687 w2 = (wordlist.index(word2)) % n
1688 w3 = (wordlist.index(word3)) % n
1689 x = w1 +n*((w2-w1)%n) +n*n*((w3-w2)%n)
1690 out += '%08x'%x
1691 return out
1692
1693
1694 if __name__ == '__main__':
1695 import sys
1696 if len(sys.argv) == 1:
1697 print('I need arguments: a hex string to encode, or a list of words to decode')
1698 elif len(sys.argv) == 2:
1699 print(' '.join(mn_encode(sys.argv[1])))
1700 else:
1701 print(mn_decode(sys.argv[1:]))