[Lazarus] input password htpasswd

waldo kitty wkitty42 at windstream.net
Thu Dec 3 11:14:49 CET 2009


Michael Van Canneyt wrote:
> 
> 
> On Wed, 2 Dec 2009, faread_w wrote:
[trim]
>> so if i use program lazarus,how to enter/input password htpasswd by 
>> using script on lazarus?
> 
> htpasswd supports a -b option, so you can do
> 
> ExecuteProcess('/usr/bin/htpasswd','-b -c tipe-file user password');

with that in mind, htpasswd also supports what? two or three modes of 
encoding/encrypting the passwords? crypt, md5, sha and plaintext...

it has been a while since i've played with creating passwords for htpasswd files 
and i didn't have a native binary for my chosen OS to do it with... i had to use 
other tools until i found the one that generated the proper output for me to 
place in the htpasswd file... sadly, that was some years ago and i don't recall 
how i did it but ii do recall that the crypt function is what it required in my 
case...

once the algorithm is known, it is a simple matter for a fpc or laz/fpc app to 
do the work directly... the md5 option is modified for apache so that should be 
easily available via the apache sources... the other methods should also be as 
easy to come by... if i'm reading correctly, the md5 format is used by default 
on windows, netware and tpf (whatever that is)... other platforms use crypt()...

now, i'm wondering why the example is wiping out the file and starting it over 
instead of removing the user's password and generating a new one... sounds like 
there's only one user listed in the file ;)




More information about the Lazarus mailing list