Is it possible to set a hashed password programatically for a user? Related to this question - with one difference. 

Is it possible to set a hashed password for a user? I'm able to save the user just fine - but when I pass the already hashed password like $user-&gt;password it doesn't set the password. I'm not seeing anything within $user-&gt;getErrors(), it's just a blank array. Any ideas?
There’s no API for it; you would need to save it to the database directly.

If any of the passwords are known to you, you should probably start by manually pasting that hashed password into your account’s password column, and verify that it’s actually going to work. Even if the old site was also using mcrypt, it’s still pretty unlikely that they get hashed the exact same way (different salts, etc.).

If it doesn’t work out, and you really don’t want to require everyone to reset their passwords, you could save all of your hashed passwords in a separate table, and write your own "login" controller action using a plugin. That controller action could:


grab the user by their given username/email

$loginName = craft()-&gt;request-&gt;getPost('loginName');
$user = craft()-&gt;users-&gt;getUserByUsernameOrEmail($loginName);

see if that user has a row in your old hashed passwords table
if so, fetch their password from post...

$password = craft()-&gt;request-&gt;getPost('password');

hash that password using the old site’s exact hashing method
if the hashed password matches the one in the table...
save the posted password on the user account

$user-&gt;newPassword = $password;
craft()-&gt;users-&gt;changePassword($user);

delete the user’s row in the old hashed passwords table (so we're only doing this once per user)
log the user in

craft()-&gt;userSession-&gt;login($loginName, $password);



(See craft/app/controllers/UsersController.php - actionLogin() for a full code example of login().)