[Cryptography] quantum computers & crypto

Christian Huitema huitema at huitema.net
Mon Nov 8 21:12:43 EST 2021


On 11/8/2021 5:06 PM, Ray Dillinger wrote:
> On 11/8/21 11:31 PM, Christian Huitema wrote:
>> On 11/8/2021 1:00 PM, Ray Dillinger wrote:
>>> But if you do 52 perfect shuffles in a row you bring the deck back into
>>> its original order.  No matter what (n) you use, it will never be 'more
>>> secure' than some (n) less than 52.  The so-called 'perfect shuffle' is
>>> actually fairly lousy considered as a randomization algorithm, but you
>>> see the point.
>> Really? Did you mean to write 52! perfect shuffles in a row?
>>
> Nope.  It's only 52.  Closed cycles of a single operation within a group
> tend to be very short on average.  52! is absolutely the longest a state
> cycle could be, 52 is "typical" for most repeated operations.
>
> No need to take my word for it though:  Try it yourself! I'm just
> eyeballing this but I bet it'll compile:
>
> int main(int argc, char **argv){
> int deck1[52]; int deck2[52]; int count; int shuffle;
> for (count = 0;count<52;count++)deck1[count]=count;
> for (shuffle=count=0;  shuffle<52;  shuffle+=(++count==52),count=count%52)
>    
> (shuffle%2?deck1:deck2)[count]=(shuffle%2?deck2:deck1)[count/2+count%2?0:26];
> for (int count = 0; count<52;count++) if (deck1[count]!=count) break;
> printf(count==52?"succeeded.\n":"failed.\n");
> }

Sorry, my laziness for not looking up "perfect shuffle" as a term of the 
art. I quick-read that as "perfectly random shuffles", and that is 
indeed not what a "perfect shuffle" is. And indeed, repeating a perfect 
shuffle 52 times is very much like repeating rot13 twice.

-- Christian Huitema
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.metzdowd.com/pipermail/cryptography/attachments/20211108/e157afe6/attachment.htm>


More information about the cryptography mailing list