Wich encrypting method ?
-
Hello.
Because Squid is unable to use my Active Directory for authentification (my tree is too complex and the search is unable to find the users), I' think the more simple is to use a local base of users.Pfsense purposes a page to create user per user but I have 1300+ users to create each year. I'd like to write a tool to convert my clear users list into an encrypted one, like pfsense do.
After a lot of search, I could find the file where usernames and passwords are saved : /var/etc/squid.passwd
Inside squid.inc php code I could find this : $contents .= $user['username'] . ':' . crypt($user['password'], base64_encode($user['password'])) . "\n";
My ask is wich encryption method is used behind the "crypt" function ?
Thanks a lot.
-
From this line in the code -
base64_encode($user['password'])) . "\n";
Seems to be base64 encoded
-
Thanks a lot.
I made custom php page to encrypt a file of users. Didn't tried it with a lot of users but worked perfectly with my tries.
This thread can be closed.
-
Glad you got it working, but for future reference: the base64_encode of the password is used as the salt parameter for crypt(). More details on php crypt are here:
http://us1.php.net/manual/en/function.crypt.php