Urgent Help - Passwords

Permalink
I am creating an external page where user register, this will then register them on concrete5 but also in a phpbb database.

What I am trying to achieve is through this external script to concrete5 is where a user registers but it creates the relevant encrypted password so that I can do a MySQL insert command to add them as a user.

my new password value is $newpassword

what php code do I need to get $encryptedpassword to be the encrypted password where i can do a MySQL insert command straight into the user database?

Many thanks