A
asg
below is a script i compiled after searching this forum. i would like
feedback on wether you think it is secure.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
use Crypt::Blowfish;
use Crypt::CBC;
$scriptname = "cbc.cgi";
$key = "dfghdfghdfghdfgh";
if(param('cypher')){ &cypher; }
elsif(param('dcypher')){ &dcypher; }
else{ &dcypher; }
sub cypher{
$cipher = new Crypt::CBC( $key, 'Blowfish' );
$decrypt = param('decrypt');
my $encrypt = encrypt($decrypt);
print qq~ <FORM METHOD = "post" NAME="f1" ACTION = "$scriptname"
ENCTYPE="multipart/form-data" >
<input type="text" name="encrypt" value="$encrypt" size="50"><BR>
<input type="submit" name="dcypher" value="Dcypher">
</form>~;
}
sub dcypher{
$cipher = new Crypt::CBC( $key, 'Blowfish' );
$encrypt = param('encrypt');
my $decrypt = decrypt($encrypt);
print qq~<FORM METHOD = "post" NAME="f1" ACTION = "$scriptname"
ENCTYPE="multipart/form-data" >
<input type="text" name="decrypt" value="$decrypt" size="50"><BR>
<input type="submit" name="cypher" value="Cypher">
</form>~;
}
sub decrypt { defined $_[0] ? $cipher->decrypt_hex($_[0]) : '' }
sub encrypt { defined $_[0] ? $cipher->encrypt_hex($_[0]) : '' }
feedback on wether you think it is secure.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use CGI qwstandard);
use CGI::Carp qw(fatalsToBrowser);
use Crypt::Blowfish;
use Crypt::CBC;
$scriptname = "cbc.cgi";
$key = "dfghdfghdfghdfgh";
if(param('cypher')){ &cypher; }
elsif(param('dcypher')){ &dcypher; }
else{ &dcypher; }
sub cypher{
$cipher = new Crypt::CBC( $key, 'Blowfish' );
$decrypt = param('decrypt');
my $encrypt = encrypt($decrypt);
print qq~ <FORM METHOD = "post" NAME="f1" ACTION = "$scriptname"
ENCTYPE="multipart/form-data" >
<input type="text" name="encrypt" value="$encrypt" size="50"><BR>
<input type="submit" name="dcypher" value="Dcypher">
</form>~;
}
sub dcypher{
$cipher = new Crypt::CBC( $key, 'Blowfish' );
$encrypt = param('encrypt');
my $decrypt = decrypt($encrypt);
print qq~<FORM METHOD = "post" NAME="f1" ACTION = "$scriptname"
ENCTYPE="multipart/form-data" >
<input type="text" name="decrypt" value="$decrypt" size="50"><BR>
<input type="submit" name="cypher" value="Cypher">
</form>~;
}
sub decrypt { defined $_[0] ? $cipher->decrypt_hex($_[0]) : '' }
sub encrypt { defined $_[0] ? $cipher->encrypt_hex($_[0]) : '' }