James Kelty wrote:

> What is the best, or workable, way to count the elements in a string? For instance,
> if someone enters a desired password through a form, I would like to be able to make
> sure that it is a certain length. I though about using the length() function, but I 
>am not
> sure if that us secure.......

I don't know what you mean by "secure", but for counting characters
length is what you need. Don't use split, it works but it does a lot
more than is really needed to count chars in a string, for larger texts
it can be a big overkill.

But if you're serious about making sure that your users are choosing
hard to guess passwords, use Crypt::Cracklib, Perl interface to Alec
Muffett's Cracklib:
http://search.cpan.org/search?dist=Crypt-Cracklib

Cracklib tests potential passwords and rejects those which could be easy
to guess using the most common password cracking techniques. If you only
check string length then someone can use something like abcdefgh or a
word from dictionary which can be long but very easy to guess.

You can find more info about Cracklib on Alec Muffett's home page:
http://www.users.dircon.co.uk/~crypto/

- RaFaL Pocztarski, [EMAIL PROTECTED]


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

Reply via email to