How can i do it in batch mode? :-s
what i have now is a text file with few words as a list (unnumbered). I
would like to encrypt these words(strings) so as to make it work as
htpasswd passwords, and possibly store there encrypted values to a new
file!
Any ideas...?
The text file which contains the words are in pass.txt..
I tried the php script posted by Mel. infact modified it a bit too:
<?
# **************************************************************
# make htaccess !
#
# 1. set all rights (chmod 777)
# 2. place this file into the directory you want to protect
# 3. start the script (
http://..../make_htaccess.php
# 4. enter login and password
# 5. press the button 'make'
# 6. ready
#
# Lars Brinkmann
# email: (e-mail address removed)
#
# **************************************************************
$pass=file("pass.txt");
foreach ($pass as $line_num => $line) {
$htpasswd_txt = crypt($passw[$line], CRYPT_STD_DES)."\n";
# save files
$htpasswd= fopen(".htpasswd", "a");
fputs($htpasswd, $htpasswd_txt);
fclose($htpasswd);
}
echo "done"."\n"; //when the entire thing is encrypted!
?>
I can see the .htpasswd file, and it seems to be encrypted as well..
but i do not know why, all the encrypted values are the same (means
encrypted values for all the words are same.. I'm sure it's not any
logical error with the loop or anything as i'm getting different
encrypted values when i use
$htpasswd_txt = crypt($passw[$line])."\n"; instead of
$htpasswd_txt = crypt($passw[$line], CRYPT_STD_DES)."\n";
But the latter seems to be producing a longer code (MD5 i believe)...
So what could be it? Any help is appreciated!