| Oakbox's
Web Crypto Interface
A small program to provide
GOOD encryption through a web interface. This script uses Cypher Block
Chaining and any of your choice of encryption schemes (Blowfish [default],
IDEA, DES, or Triple-DES)
If you decide to install this
script on your web server, you should be aware that transmitting clear
text over the internet is NOT secure. You should only use this interface
on a SSL-protected web site (https://)
Download Oakbox's Web Crypto
Interface
|
Here is the TEXT of the script:
#!/usr/bin/perl -w
# Oakbox's Web Crypto Interface
# by Richard Still (c) 2001 http://www.oakbox.com
#
# Set this script up behind a SSL web connection. This script takes
# an input message and a key, then encrypts the message using your key
# and your installed cryptographic scheme.
#
# The output hex code is broken up to easily fit into the body of
# an email message.
#
# To Decrypt a message, simply enter your encrypted text and your key.
# The script strips carriage returns and spaces are removed from the
# input text and then attempts to decrypt the message with the set
# encryption scheme.
#
# Required modules
# Crypt::CBC
# AND at least one of the following:
# Crypt::Blowfish
# Crypt::IDEA
# Crypt::DES
# (See the documentation for the Crypt::CBC script to see what other
# encryption schemes can be used with this system)
#############
# Legalese to CMA:
# "Oakbox's Web Crypto Interface" is a copyrighted work
# and may not be redistributed without written permission
# of author. The author makes no guarantee of merchantability
# or suitability for a particular purpose. User acknowledges
# that author is not liable for any damages, direct or indirect,
# caused by the use of this script.
#
# Please report any bugs or suggestions for this script to
# crypto_script@oakbox.com
#
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard);
use Crypt::CBC;
use strict;
my $crypt_scheme = "Blowfish";
my $query = new CGI;
print header;
if($query->param('action') eq "encrypt"){
# encrypt
my $cipher = new Crypt::CBC($query->param('key'),$crypt_scheme);
my $ciphertext = $cipher->encrypt_hex($query->param('love'));
$ciphertext =~ s/(\S{50})/$1 /mg;
print start_html('Encrypted Text'),
"Your code is",p,start_form,textarea(-name=>'foo', -default=>$ciphertext, -rows=>10, -columns=>90),end_form;
}
if($query->param('action') eq "decrypt"){
# decrypt
my $plain=param('love');
$plain=~ tr/A-Z0-9a-z/ /c;
$plain=~ s/ //g;
my $cipher = new Crypt::CBC($query->param('key'),$crypt_scheme);
my $plaintext = $cipher->decrypt_hex($plain);
print start_html('Decrypted Text'),
" Your text is",p,textarea(-name=>'foo', -default=>"$plaintext", -rows=>10, -columns=>90);
}
# This is where you can customize the interface 'look' of this script!
print hr,
qq( <p align="center"><font size="+1">Web-based Crypto from <a href="http://www.oakbox.com">Oakbox</a>!</font>
<form method="post" action="oakboxwci.cgi">
<p align="center">Enter text to be Encrypted/Decrypted :<br>
<textarea name="love" cols="60" rows="10"></textarea>
</p>
<p align="center">Enter the Passkey <i><font size="-1">(use a key appropriate
for $crypt_scheme encryption!)</font></i>:<br>
<input type="text" name="key" size="50">
</p>
<p align="center">Select action:
<input type="radio" name="action" value="encrypt" checked>
Encode
<input type="radio" name="action" value="decrypt">
Decode <br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<font size="-1">Script created by <a href="http://www.oakbox.com">Richard Still,
<br>
Oakbox Productions</a> Copyright © 2001 <br>
All rights reserved. </font> ),
end_form;
print end_html;
exit;
Oakbox Productions,
All rights reserved. © 1999, 2000
All scripts, advice, and information offered are offered
as-is with no guarantee as to useabilty or utility for a particular purpose.
I cannot assume any responsibility for your implementation of this information,
because I have no control over it when it leaves this site. I do not sell
or share your information with anyone. |
|