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

i'm trying to write a basic email client application for perl on a windows system through TCP and SMTP sockets.

first question: is there some way to not echo the user's password input on the screen? or perhaps replace it with xxx's? basically i want a password prompt and the user to enter the password, but i don't want the entered password to show up on screen.

second question: is there an automated way (a module perhaps) to send encrypted data over a TCP connection (again the password)? or would i have to somehow organize this in conjunction with the server?

thanks for any help.

Replies are listed 'Best First'.
Re: TCP encryption/security
by ZZamboni (Curate) on Jun 30, 2000 at 00:46 UTC
    Second answer: it depends on how complex you want to get. But in any case, you will need the server to act in conjunction, because the server needs to decrypt things on its end. If the password is all you need to be encrypted, I can think of the following alternatives:
    • Use SSL. A search for ssl in cpan reveals Crypt::SSLeay, IO::Socket::SSL and some others. I've not used any of them, though.
    • Use S/Key (also known as OPIE for "One-time Passwords in Everything). This is a technique specifically designed for sending passwords, and is very effective and even standardized (try RFC1760 and RFC1938). Unfortunately, I don't think there is a Perl module for computing S/Key challenges/responses. Also, S/Key is a higher-maintenance system, because the user needs to reset his passwords every once in a while. One good place to start looking for implementations is http://www.inner.net/pub/opie/.

    --ZZamboni

Re: TCP encryption/security
by btrott (Parson) on Jun 29, 2000 at 23:36 UTC
      allright... but now i'm getting this message when i try to use the package:

      can't locate loadable object for module Term::ReadKey in @INC.

      i have no idea what that error message means. the package is there... downloaded straight from CPAN. it appears to be some problem with the use statement, because thats whats setting off the error.
      any ideas? is it something wrong with the package?
        Did you install it from CPAN, or just install the .pm file? Term::ReadKey has an XS component that needs to be compiled and installed correctly; that error message means that the compiled shared object couldn't be found. Which means, most likely, that it wasn't installed properly.