On Tue, Feb 08, 2000 at 05:38:26PM +0000, Bruno Salgueiro wrote:
> Hi to all.
>
> I would like to know if or when will the OpenSSL have a nice Perl
> interface. IMHO this will be one important factor to use cryptography
> in CGIs or in Apache modules (as an example) without having to bother
> with the oddities of C and memory management.
> By nice I mean one that works, even if it has the same functionali-
> ty and the same way to program as the toolkit has nowadays.
>
> If this not possible with OpenSSL does anyone know of a crypto modu-
> le for Perl, even if it is not freeware?
That's a good question. If nothing else, you can use Perl's nifty
piping functionality. For me (under Unix), I can do this:
---SOF---
#!/usr/bin/perl
open(DES3, "|ssleay des3 -a -e -k blah");
print DES3 "Encrypt this for me, please.\n";
while (<DES3>) { print "$_"; }
---EOF---
Which produces
'1njGa0Ohmu9Of5cvSEQ5iTF8qiJTw+tAq8FzTZAmKk00oU+UZCPPqw==', when in
turn can be verified:
echo "1njGa0Ohmu9Of5cvSEQ5iTF8qiJTw+tAq8FzTZAmKk00oU+UZCPPqw==" \
| ssleay des3 -d -a
enter des-ede3-cbc decryption password: [I typed 'blah']
Encrypt this for me, please.
I hope that helps!
Phil
--
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR
[EMAIL PROTECTED] -- http://www.netroedge.com/~phil
PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]