Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: sci.crypt Subject: Re: Manually generating a key with dice Date: Mon, 04 Mar 2024 21:45:09 +0000 Organization: A noiseless patient Spider Lines: 65 Message-ID: <87o7btk6xm.fsf@bsb.me.uk> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="55b12cd97f483f0b07ab5f700525753a"; logging-data="3537975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SoE6kCmZ6z/EAzbcvLx+U6/DvoGN/qTY=" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:wLPRzK2Fbm6TmodqjOAM2coujp8= sha1:8P0bkq/I8ByO+wv4oFp2b80dysI= X-BSB-Auth: 1.3c72820a6f1f443ce489.20240304214509GMT.87o7btk6xm.fsf@bsb.me.uk Xref: csiph.com sci.crypt:257364 Stefan Claas writes: > Rich wrote: > >> Stefan Claas wrote: >> > Chax Plore wrote: >> > >> >> Hi, >> >> >> >> My suggestion, which is probably "information-theoretically >> >> correct" is to simply base-convert the "base 6" sequence of dice >> >> digits to base required (base 10 or base 26 or any other base) and >> >> then delete the first sign of result (which will be biased, >> >> because first sign of output base - the "zero" of given base - >> >> will never appear on first place). >> >> >> >> It is easy to adapt this arbitrary base converter to "dice base" >> >> of digits 1-6 and then get all output bases needed: >> >> >> >> https://github.com/zamicol/BaseConverter >> > >> > Hi thanks for your suggestion! >> > >> > I must admit I do not fully understand, language barrier, but will >> > translate your steps and see how it works, i.e. if the procedure is >> > to time consuming; compared to my wooden tiles procedure, or any >> > other solution, which may come up here. >> >> A six sided die provdes numerals 1 to 6. >> >> This can also be viewed as a "base-6" numeral (0 to 5), scaled by >> adding one. >> >> So each dice roll produces one digit of a base-6 numeral. If you >> want a four digit base-6 numeral, roll one die four times in a row, >> recording each (adjusted by -1 for each roll to aquire numerals 0-5, >> made up values below, I did not actually roll a die): >> >> 3520 (base-6) >> >> Then, convert to your "base of choice" (6^0 left on for symmetry, >> parens added to make the precedence explicit below): >> >> 3*(6^3) + 5*(6^2) + 2*(6^1) + 0*(6^0) = 840 (base 10) > > Ah, ok! Now I understand. Thanks for explaining, much appreciated. Just a quick side note... Just two dice (or two rolls of one die) gives you 36 different outcomes. That's neat if you want to generate English letters and digits. You don't need to do the base conversion if you just agree on a grid: | 1 2 3 4 5 6 --+------------ 1 | A B C D E F 2 | G H I J K L 3 | M N O P Q R 4 | S T U V W X 5 | Y Z 0 1 2 3 6 | 4 5 6 7 8 9 First roll picks the row, second roll picks the column. -- Ben.