gandalf458 — 2014-02-25T06:01:15-05:00 — #1
I'm trying to find a good way to create a random salt to encrypt a password as in
I've googled and googled but can't find a suitable answer. One suggestion was
which is hardly random.
I'm using PHP 5.3
Any ideas welcome. Thanks.
1119 — 2014-02-25T06:29:06-05:00 — #2
What are you wanting to do?
It is better to know what your needs are and then someone can best advise you.
patche — 2014-02-25T07:16:33-05:00 — #3
Why not do...
$password = "hello123";
$random_salt = md5(rand(1,1000000000000) . date("y-m-d h:i:s") . "8239fjefjwfkk");
$password = crypt($password, $random_salt);
gandalf458 — 2014-02-25T07:16:36-05:00 — #4
What I want to do is create an encrypted password for use with .htaccess/.htpasswd
gandalf458 — 2014-02-25T07:17:39-05:00 — #5