Hi Octavian ,

I'm afraid that's how crypt() (the UNIX function) is. Here's an extract from man crypt:

By taking the lowest 7 bits of each of the first eight
characters of the key, a 56-bit key is obtained. This
56-bit key is used to encrypt repeatedly a constant string
(usually a string consisting of all zeros).


I would suggest using Crypt::DES ...


R

At 09:07 24/10/2002 +0200, Octavian Rasnita wrote:
Hi all,

I've tried to use the crypt function to crypt a string longer than 8
characters but only the first 8 characters are considered.

I have used (like an example):

my $string = "1234567890";
my $result = crypt($string, $string);

Then I verify with:

if ($result eq crypt($string, $result)) {
print "ok";
}

.... but I could also verify with:

if ($result eq crypt("12345678", $result)) {
print "ok";
}

And it verifies with only the first 8 characters.

Thanks.

Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to