how to get password as submitted by the user in hook_user_insert?
Any hook that is invoked from user_save() is too late to get the password as entered from the user. In fact, the first lines executed from user_save() are the following ones.

if (!empty($edit['pass'])) {
  // Allow alternate password hashing schemes.
  require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
  $edit['pass'] = user_hash_password(trim($edit['pass']));
  // Abort if the hashing failed and returned FALSE.
  if (!$edit['pass']) {
    return FALSE;
  }
}


What you can do is adding a form submission handler to the form used to create new user accounts. That submission handler can access the password as entered from the user in $form_state['values']['pass']. I would rather add a form submission handler that is executed right after user_register_submit(), as that submission handler contains the following code.

  if (!variable_get('user_email_verification', TRUE) || $admin) {
    $pass = $form_state['values']['pass'];
  }
  else {
    $pass = user_password();
  }
  $notify = !empty($form_state['values']['notify']);

  // Remove unneeded values.
  form_state_values_clean($form_state);

  $form_state['values']['pass'] = $pass;


I would use the following code.

function mymodule_form_user_register_form_alter(&amp;$form, &amp;$form_state) {
  // Add your submission handler.
  $form['#submit'][] = 'mymodule_user_register_submit';
}

function mymodule_user_register_submit(&amp;$form, &amp;$form_state) {
  // The password is in $form_state['values']['pass'].
}