smackdab has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am VERY new to OO stuff, but I went a searching for an easy way to encrypt my io::socket::inet traffic...

I know I can encrypt it before syswriting() it, but it seems like there should be a way to create a io::socket::inet::encrypted class

Since it didn't seem to be on CPAN, do I just create my own module, somewhat like this (pseudo code)

package io::socket::inet::encrypted; use base qw(io::socket::inet); then override methods, like syswrite()? sub syswrite { my $buf = $_[0]; $buf = crypt($buf); base::syswrite($buf); # I don't know what base is... # of if I use @ISA and SUPER:: }
I just want to make sure I get some advice and that I am on the right track before I go chasing gooses ;-)

THANKS

Replies are listed 'Best First'.
IO::Socket::SSL
by RMGir (Prior) on Apr 27, 2002 at 15:52 UTC
    Good idea!

    So good, in fact, that IO::Socket::SSL does exactly that :)

    You might want to consider using that module, since its security is likely to be better than what you come up with yourself, given how many gotchas there are in writing secure comm code.
    --
    Mike