I have been reading a few encrytption articles on encrypting passwords in PHP and they all seem to be pretty inconclusive with reader comments saying "this is stupid you should do it like this". I have been messing around with encryption and have come up with this bearing in mind i have been using php for a number of days so you could say im a noob :)

```
<?php 
    $salt = uniqid(mt_rand(), true);
    $hashedPassword = sha1( $userPassword . $salt );
?>

```