EasyTCP
view release on metacpan or search on metacpan
negotiating with a newly connected client.
0.04
- Fixed a bug where older versions of Crypt::CBC were not called correctly causing "make test"
and almost everything else to fail.
- Minor changes to the protocol negotiation
0.03
- Added encryption support for Crypt::DES_EDE3, Crypt::DES and Crypt::Blowfish
- Added 2 new methods to determine what type of compression and encryption has been negotiated.
0.02
- Implemented transparent compression
- Implemented transparent encryption
- Internal protocol majorly re-designed to accomodate new and future features
- Re-wrote the test routine to use fork() and simulate a real-world scenario
- Minor bugfixes in receive()
#
# MAKE SURE WE DO NOT EVER ASSIGN THE SAME KEY TO MORE THAN ONE MODULE, EVEN OLD ONES NO LONGER IN THE LIST
#
# HIGHEST EVER USED: E
#
[ 'B', 'Crypt::RSA', 0, 0 ],
[ '3', 'Crypt::CBC', 0, 0 ],
[ 'A', 'Crypt::Rijndael', 1, 1 ],
[ '9', 'Crypt::RC6', 1, 1 ],
[ '4', 'Crypt::Blowfish', 1, 1 ],
[ '6', 'Crypt::DES_EDE3', 1, 1 ],
[ '5', 'Crypt::DES', 1, 1 ],
[ 'C', 'Crypt::Twofish2', 1, 1 ],
[ 'D', 'Crypt::Twofish', 1, 1 ],
[ 'E', 'Crypt::TEA', 1, 1 ],
[ '2', 'Crypt::CipherSaber', 0, 1 ],
);
my @_misc_modules = (
#
# MAKE SURE WE DO NOT EVER ASSIGN THE SAME KEY TO MORE THAN ONE MODULE, EVEN OLD ONES NO LONGER IN THE LIST
# (this is not as necessary as compress and encrypt since it's not transmitted to peers, but just in case...)
=back
=head1 COMPRESSION AND ENCRYPTION
Clients and servers written using this class will automatically compress and/or encrypt the transferred data if the appropriate modules are found.
Compression will be automatically enabled if one (or more) of: L<Compress::Zlib|Compress::Zlib> or L<Compress::LZF|Compress::LZF> are installed on both the client and the server.
As-symmetric encryption will be automatically enabled if L<Crypt::RSA|Crypt::RSA> is installed on both the client and the server.
Symmetric encryption will be automatically enabled if one (or more) of: L<Crypt::Rijndael|Crypt::Rijndael>* or L<Crypt::RC6|Crypt::RC6>* or L<Crypt::Blowfish|Crypt::Blowfish>* or L<Crypt::DES_EDE3|Crypt::DES_EDE3>* or L<Crypt::DES|Crypt::DES>* or L<C...
Strong randomization will be automatically enabled if L<Crypt::Random|Crypt::Random> is installed; otherwise perl's internal rand() is used to generate random keys.
Preference to the compression/encryption method used is determind by availablity checking following the order in which they are presented in the above lists.
Note that during the negotiation upon connection, servers and clients written using Net::EasyTCP version lower than 0.20 communicated the version of the selected encryption/compression modules. If a version mismatch is found, the client reported a c...
To find out which module(s) have been negotiated for use you can use the compression() and encryption() methods.
* Note that for this class's purposes, L<Crypt::CBC|Crypt::CBC> is a requirement to use any of the encryption modules with a * next to it's name in the above list. So eventhough you may have these modules installed on both the client and the server,...
=back
=head1 AUTHOR
Mina Naguib
http://www.topfx.com
mnaguib@cpan.org
=head1 SEE ALSO
Perl(1), L<IO::Socket>, L<IO::Select>, L<Compress::Zlib>, L<Compress::LZF>, L<Crypt::RSA>, L<Crypt::CBC>, L<Crypt::Rijndael>, L<Crypt::RC6>, L<Crypt::Blowfish>, L<Crypt::DES_EDE3>, L<Crypt::DES>, L<Crypt::Twofish2>, L<Crypt::Twofish>, L<Crypt::TEA>, ...
=head1 COPYRIGHT
Copyright (C) 2001-2003 Mina Naguib. All rights reserved. Use is subject to the Perl license.
=cut
#
# The main constructor. This calls either _new_client or _new_server depending on the supplied mode
#
$key2 = $key1;
}
elsif ($module eq 'Crypt::RC6') {
$key1 = _genrandstring(32);
$key2 = $key1;
}
elsif ($module eq 'Crypt::Blowfish') {
$key1 = _genrandstring(56);
$key2 = $key1;
}
elsif ($module eq 'Crypt::DES_EDE3') {
$key1 = _genrandstring(24);
$key2 = $key1;
}
elsif ($module eq 'Crypt::DES') {
$key1 = _genrandstring(8);
$key2 = $key1;
}
elsif ($module eq 'Crypt::Twofish2') {
$key1 = _genrandstring(32);
$key2 = $key1;
}
elsif ($module eq 'Crypt::Twofish') {
$key1 = _genrandstring(32);
$key2 = $key1;
( run in 0.241 second using v1.01-cache-2.11-cpan-9a3d99fc6dc )