Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^4: Random Derangement Of An Array (rotate)

by moritz (Cardinal)
on Jul 09, 2008 at 18:36 UTC ( [id://696518]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Random Derangement Of An Array (rotate)
in thread Random Derangement Of An Array

I am writing a game for a relative to generate cryptograms.

Use List::Util::shuffle for the key generation. It's not bad to map letters in the clear text to the same letter in the cypher text - as long as it's not more often than the statistical average.

Actually the Enigma forbade that, which was one of the reasons why it could be broken during the second world war.

BTW a common scheme for generating a key was to take a word, remove all duplicate characters, and fill the rest of the alphabet from the back:

key: LimbicRegion removed duplicates: limbcregon filled with the rest of the alphabet: limbcregonzyxwvutsrqpkjhfdcba

But that's not very secure, and mostly of historical interest ;-)

Replies are listed 'Best First'.
Re^5: Random Derangement Of An Array (rotate)
by Limbic~Region (Chancellor) on Jul 09, 2008 at 21:58 UTC
    moritz,
    It's not bad to map letters in the clear text to the same letter in the cypher text - as long as it's not more often than the statistical average.

    No, it isn't bad - it is just wrong. To quote wikipedia on cryptogram, "...each letter is replaced by a different letter." Perhaps you don't know anyone who likes to do these puzzles but they would be extremely upset if they found one of the letters mapped to itself.

    Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://696518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-19 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found