Category: | Cryptography |
Author/Contact Info | Asmo - asmo@mail.be - www.chez.com/xasmox (site in french) |
Description: | This is my first package. It seems to work fine ;) It's some sort of personal encryption algorithm that uses XOR, pack, tr, and some weird key transformations. To use it : require 'asmocript.pl'; AsmoCrypt::acrypt($sentence,$key); to crypt a sentence and AsmoCrypt::adecrypt($sentence,$key); to uncrypt a crypted sentence. I apologize for my bad english ;) Asmo |
package AsmoCrypt; BEGIN { } sub acrypt { $phrase = shift(@_); $key = shift(@_); @cles = split(//, $key); foreach $key2(@cles) { chr($key2); push(@key3, $key2); } $lastkey = join("1", @key3); $phrase = $phrase ^ $lastkey; $phrase2 = pack("u", "$phrase"); $phrase2 =~ tr /0123456789`\;$=&:!<>,@%\'-\"?/asmoeturlzxicndpqhcfg +vwkyj/; $result = $phrase2 ^ $lastkey; print $result; } return 1; sub adecrypt { $phrase = shift(@_); $key = shift(@_);; @cles = split(//, $key); foreach $key2(@cles) { chr($key2); push(@key3, $key2); } $lastkey = join("1", @key3); $phrase2 = $phrase ^ $lastkey; $phrase2 =~ tr /asmoeturlzxicndpqhcfgvwkyj/0123456789`\;$=&:!<>,@%\ +'-\"?/; $phrase3 = unpack("u", "$phrase2"); $result = $phrase3 ^ $lastkey; print $result; } END { } |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Personal crypting algorithm
by wog (Curate) on Nov 05, 2001 at 01:36 UTC | |
by Asmo (Monk) on Nov 05, 2001 at 01:56 UTC | |
by no_slogan (Deacon) on Nov 06, 2001 at 01:53 UTC | |
Re: Personal crypting algorithm
by premchai21 (Curate) on Nov 05, 2001 at 22:39 UTC | |
by Asmo (Monk) on Nov 05, 2001 at 22:59 UTC | |
by premchai21 (Curate) on Nov 06, 2001 at 03:26 UTC |
Back to
Code Catacombs