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 ;-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|