Operating System - Linux
1753792 Members
7373 Online
108799 Solutions
New Discussion

Re: password .. tricky question

 
Matti_Kurkela
Honored Contributor

Re: password .. tricky question

Remember that if the user needs to execute a script, he/she must be able to read it.

If the user can read a script, he/she can also make a copy of it. Then he/she can edit his/her own copy of the script and remove all password checks you can make. If the user runs the modified script, it will be able to do the same things the password-protected version would.

If this problem is solvable in your specific case, consider storing a md5sum of the password instead of the password itself. When the user inputs the password, you can then pipe the user input through md5sum and then compare the md5sums. If they match, the password is correct.
MK
g33k
Valued Contributor

Re: password .. tricky question

Matti pls. note one more thing... not even md5sum is safe becuase of md5 colisions and ofcourse rainbow crack(well need a lot of space but it's not such problem). If I should do sometihng similar I would use radder some salted hash md5crypt for example.

But anyway we all here know that telnet and ftp are not save in any case.