How it worksEncodingStart with an integer x in the range [0, m) [5] — cracking the encoded output will take the same amount of work as guessing x .Example:Select m = 220 and randomly choose x = 901713 .Run a parameter search to find the smallest number of tuples that can represent m . The result will depend on the number wordlists in use and how many words each contains. The algorithms work with any number of wordlists of arbitrary size, but any given word cannot appear in multiple lists.Example:Use three wordlists containing 11, 13 and 7 words respectively.The notation nCk refers to the number of ways k items can be chosen from a list of n items[6].11C1 × 13C1 × 7C1 = 1001 < m 11C2 × 13C2 × 7C2 = 90090 < m 11C3 × 13C3 × 7C3 = 1651650 ≥ m So three tuples of are needed, nine words total.Break down x into smaller ones, each corresponding to a combination of words from one of the wordlists.Example:t = x = 901713 11C3 = 165; c1 = t mod 165 = 153; t = t div 165 = 5464 13C3 = 286; c2 = t mod 286 = 104; t = t div 286 = 20 7C3 = 35; c3 = t mod 35 = 20; t = t div 35 = 0 So c = (153, 104, 20) .Convert the combination number for each wordlist into a set of positions using a combinatorial number system.Example:t = c1 = 153 11C3 = 165 > t 10C3 = 120 ≤ t; p1 = 10; t = t − 120 = 33 9C2 = 36 > t 8C2 = 28 ≤ t; p2 = 8; t = t − 28 = 5 6C1 = 6 > t 5C1 = 5 ≤ t; p3 = 5; t = t − 5 = 0 So p = (10, 8, 5) for this wordlist.Words taken based on those computed positions are grouped into tuples.A canonical string representation of those word tuples is returned as the output passphrase.DecodingStart with a typed passphrase.The typed passphrase is converted to lowercase and any character that’s not a letter or space is removed. Wherever possible typos are corrected and missing spaces are restored.The words are converted into sets of positions for each wordlist using lookup tables. These tables also have alternate spellings and verb tenses for many words.The sets of positions are turned back into a number for each wordlist by reversing the combinatorial encoding.Those numbers are combined back into the original integer.EfficiencyThe number of bits represented by w words from a set of n wordlists W1…Wn respectively containing |Wi| words, where w is an integer multiple of n , can be computed as follows:In other words, take the sum of the binary logarithms of the number of possible ways to choose w ÷ n words from each wordlist, rounding down. With the wordlists used in this demo, we get the following values:Words3691215213036516090141288369Bits 24 44 64 82 99130173200260293389516720754Notice that as the number of words increases we get diminishing returns on the number of bits represented — this is the price of order insensitivity.
EncodingStart with an integer x in the range [0, m) [5] — cracking the encoded output will take the same amount of work as guessing x .Example:Select m = 220 and randomly choose x = 901713 .Run a parameter search to find the smallest number of tuples that can represent m . The result will depend on the number wordlists in use and how many words each contains. The algorithms work with any number of wordlists of arbitrary size, but any given word cannot appear in multiple lists.Example:Use three wordlists containing 11, 13 and 7 words respectively.The notation nCk refers to the number of ways k items can be chosen from a list of n items[6].11C1 × 13C1 × 7C1 = 1001 < m 11C2 × 13C2 × 7C2 = 90090 < m 11C3 × 13C3 × 7C3 = 1651650 ≥ m So three tuples of are needed, nine words total.Break down x into smaller ones, each corresponding to a combination of words from one of the wordlists.Example:t = x = 901713 11C3 = 165; c1 = t mod 165 = 153; t = t div 165 = 5464 13C3 = 286; c2 = t mod 286 = 104; t = t div 286 = 20 7C3 = 35; c3 = t mod 35 = 20; t = t div 35 = 0 So c = (153, 104, 20) .Convert the combination number for each wordlist into a set of positions using a combinatorial number system.Example:t = c1 = 153 11C3 = 165 > t 10C3 = 120 ≤ t; p1 = 10; t = t − 120 = 33 9C2 = 36 > t 8C2 = 28 ≤ t; p2 = 8; t = t − 28 = 5 6C1 = 6 > t 5C1 = 5 ≤ t; p3 = 5; t = t − 5 = 0 So p = (10, 8, 5) for this wordlist.Words taken based on those computed positions are grouped into tuples.A canonical string representation of those word tuples is returned as the output passphrase.