Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

(Ovid) Re: Requesting feedback

by Ovid (Cardinal)
on Mar 25, 2002 at 22:18 UTC ( [id://154245]=note: print w/replies, xml ) Need Help??


in reply to Requesting feedback

sifukurt wrote (in the POD) "It does offer a degree of security".

Actually, I would tend to disagree as it's a simple substitution cipher. Anyone trying to read the output is going to realize that it's terribly random and, if they want to know what it contains, will quickly decipher it. Steganography is an information hiding technique that works best when combined with true encryption. Make your module inherit from another, have the user supply a secret (or work out a public key system?), encrypt the data and then run your module over it. If someone realizes that the "play" is hiding something, they'll still have the encryption hurdle to climb. Alternately, give the user the choice of encryption system, keylength, and maybe the choice of symmetric or public keys. Until then, this should be in the Acme:: namespace.

Fun module, though :)

Side notes: You require Exporter but don't use it.

Too many globals will make it tough to maintain.

Abstract out "magic" variables. For example:

if ( $name =~ /^\[/ && ! $val ) {

It's not immediately clear that stage directions indicate a newline. You have to search for this snippet to understand:

sub StageDirections { return "[ " . RandomElement( \@Names ) . " " . RandomElement( \@Ac +tions ) . ". ]\n"; }

Take out the "[" and replace it with something from this:

my %stage_direction_delimiter = ( left => '[', right => ']' );

I realize that this variable name is too long, but you get the idea. If someone wants to "tweak" things, they'll thank you!

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid) Re: Requesting feedback
by sifukurt (Hermit) on Mar 25, 2002 at 22:27 UTC
    Hmmm...good point. Don't get me wrong, I'm not saying this is strong crypto by any stretch of the imagination. It does, however, have more than a one-to-one substitution for the commonly used characters. For example, if "r" comes up as the first of the two characters it grabs, it chooses from 10 different names. For less frequently used letters, say "x" for example, it is a one-to-one substitution. At first I was thinking the Acme:: name space, but it does actually provide a somewhat higher degree of security than Crypt::Rot13, for example. Since Rot13 is a true one-to-one subsitution cipher, I suppose a better argument could be made for moving Rot13 to the Acme:: namespace than for keeping Playwright under the Crypt:: namespace, though.
    ___________________
    Kurt
      The difference is that Crypt::Rot13 has a useful purpose (in usenet etc) and that your module, while interesting, isn't really any use in production code.

      gav^

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found