You cannot decrypt the password back. Only encryption can match the password. So in case you don't know what is the real password, but you want to store real password on C++ program or use that. I recommend you add another field in users table of your PHP script and name it real_password, where you can save the real password by user.
I am not using any prefix or Secret Hash with Passwords . The Password is just hashed
$password = md5($password);
Which take $password user input and change it to md5 hash.
So to save real password in your login script, you can even use the user_meta table. which will give you real password according to user ID.
So in file >> lib >> classes >> users.php find These functions to modify to store real password.
function register_user(
function edit_profile(
function update_user(
function reset_pass_user(
function add_user(
And here is the function which you can use in all above funcitons to store the real password to set. If you are using it inside same class users.php
//Save user input password to new variable $realpassword before encryption.
$this->set_user_meta($user_id, 'realPassword', $realpassword);
//And when you want to get the password back. You have to pass $user_id;
//To call this function outside $users class
$user_real_pass = $new_user->get_user_meta($user_id, 'realPassword');
//To call inside the users class use $this-> instead of $new_user->
$user_real_pass = $this->get_user_meta($user_id, 'realPassword');
To get the User ID of loged in user you can use Session variable.
$_SESSION['user_id']
Thanks. You need knowledge of PHP to modify and further work on this script. I don't know C++ but SQL cannot be connected with PHP so its upto you how you use both databases together.