in reply to Re: File/Data Streaming over a socket
in thread File/Data Streaming over a socket

Please forgive my ignorance, but how do you implement a socket password? This will be open to the internet and files that it will receive will at most, 200Kb. Thanks all for your help to!
  • Comment on Re^2: File/Data Streaming over a socket

Replies are listed 'Best First'.
Re^3: File/Data Streaming over a socket
by zentara (Cardinal) on Mar 18, 2005 at 14:03 UTC
    It's alot easier to use Net::EasyTCP. Here are a couple of snippets that I posted awhile back Sockets-File-Upload with Net::EasyTCP. It has port passwords, usernames and logons, and is encrypted. Read the Net::EasyTCP docs for details. Now Net::EasyTCP uses IO::Select, so that means if a second client connects, while another is currently uploading, it will have to wait for the first upload to finish.(Remember the forking? This dosn't fork). Net::EasyTCP also has a "refuse connection" list, you can employ if out on the NET and some ipaddress is hacking, but not logging on. You can do something like count logon attempts, then after 10 failures, put them in a @banned-ips list.

    Also, when I wrote that snippet, there was a problem with RSA(as mentioned), but the module now has an option to handle this:

    my @nocrypt = qw(Crypt::RSA); #too slow, but more secure #my @nocompress = qw(Compress::LZF); #just testing this feature $server = new Net::EasyTCP( host => $host, mode => 'server', port => $port, password => $portpassword, # if asymmetric encryption # use a port password donotencryptwith => \@nocrypt, # donotencrypt => 1,
    I have another snippet that implements these ideas at ztk-enchat encrypted server client

    I'm not really a human, but I play one on earth. flash japh
Re^3: File/Data Streaming over a socket
by starbolin (Hermit) on Mar 18, 2005 at 02:20 UTC

    1) A socket is just an association between a protocol ( port, address ) and a descriptor ( filehandle ).

    2) An application connected to the public internet with only password protection offers only false security.

    3) Go to http://search.cpan.org and search for security.

    4) Posting a new question in an existing thread is a faux pax.

    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}