|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: HP Secure Web Console
Subject: Re: HP Secure Web Console
From: Randal L. Schwartz (merlyn
STONEHENGE.COM)
Date: Mon Dec 06 1999 - 12:04:34 CST
- Next message: Craig Ruefenacht: "Re: Solaris 2.x chkperm/arp vulnerabilities"
- Previous message: Aleph One: "w00giving #8] Solaris 2.7's snoop"
- Next in thread: Thillmann, Rolf: "Re: HP Secure Web Console"
- Maybe reply: Randal L. Schwartz: "Re: HP Secure Web Console"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>>>>> "GNSS" == GNSS Research Division <osiris
gnss.com> writes:
GNSS> #!/bin/perl
GNSS> #
GNSS> # swc_crypt_test
GNSS> #
GNSS> # Syntax: swc_crypt_test [option] [word]
GNSS> #
GNSS> # encrypt example: swc_crypt_test -e abcd
GNSS> # output: VUTS
GNSS> #
GNSS> # decrypt example: swc_crypt_test -d VUTS
GNSS> # output: ABCD
GNSS> #
GNSS> if(!$ARGV[0]) { &usage; } if($ARGV[0] ne "-e" && $ARGV[0] ne "-d") { &usage; }
GNSS> if($ARGV[0] eq "-e") {
GNSS> $string=$ARGV[1];
GNSS> $string=~s/(.*)/\u\U$1/g;
That doesn't make sense. Do you mean:
$string = uc $string;
there?
GNSS> $string=~y/A-Za-z/S-ZA-za-m/;
This also doesn't make sense. You have 52 things on the left,
and 79 things on the right in the order of:
STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzabcdefghijklm
If you meant to do a modified caesar rotate where A becomes S, that'd be:
$string =~ y/A-Za-z/S-ZA-Rs-za-r/;
Of course, the second half of that would never trigger, since you just
uppercased everything, so you could simply combine the two steps with:
$string =~ y/A-Za-z/S-ZA-RS-ZA-R/;
GNSS> $output = reverse $string; print $output;
GNSS> }
GNSS> if($ARGV[0] eq "-d") {
GNSS> $string=$ARGV[1]; $string=~y/S-ZA-za-m/A-Za-z/;
Ditto here.... perhaps you want:
$string =~ y/S-ZA-Rs-za-r/A-Za-z/;
GNSS> $string=~s/(.*)/\l\L$1/g;
And again, if you want to lowercase everything, use:
$string = lc $string;
And the combination move would be:
$string =~ y/S-ZA-Rs-za-r/a-za-z/;
GNSS> $output = reverse $string; print $output; }
GNSS> sub usage {
GNSS> print "\nUsage: poor_crypt [option] [word]\n";
GNSS> print "\n-e encrypts the supplied string";
GNSS> print "\n-d decrypts the supplied string\n";
GNSS> print "\n***Note: your string MUST be in uppercase.\n";
GNSS> exit;
GNSS> }
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlynstonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
- Next message: Craig Ruefenacht: "Re: Solaris 2.x chkperm/arp vulnerabilities"
- Previous message: Aleph One: "w00giving #8] Solaris 2.7's snoop"
- Next in thread: Thillmann, Rolf: "Re: HP Secure Web Console"
- Maybe reply: Randal L. Schwartz: "Re: HP Secure Web Console"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
This archive was generated by hypermail 2b27 : Tue Dec 07 1999 - 10:14:51 CST