Drupal – Encrypt form(input,passwords) values before form submit in custom module

I would like to modify (encrypt) the form input values in custom module in Drupal, before it sends it decrypted to server. I tried encryption in form submit function and it is working fine, but still some tools finding the plain text data(password) while sending to server.

Can we do it custom_my_form function only? Is there a way to solve it?

custom_my_form($form, &$form_state) {
        $form['user_firstname'] = array(
            '#type' => 'textfield',
            '#title' => 'ID',
        );
        $form['user_email'] = array(
            '#type' => 'textfield',
            '#title' => 'Email',            
        );
        $form['user_pwd'] = array(
            '#type' => 'password_confirm',
            '#required' => TRUE,
        );
        $form['submit_button'] = array(
            '#type' => 'submit',
            '#value' => 'Submit',
        );      
      return $form;
    }

    function custom_my_form_submit($form, &$form_state) {   
       //Here it is working fine,
        $fname = md5($form_state['values']['user_firstname']);
        $email = md5($form_state['values']['user_email']);
        $pwd = md5($form_state['values']['user_pwd']);
        $values = array(
            'Form_Req' => array(
                'Header' => array(
                    'Info' => 'xyz',                
                ),
                'Body' => array(    
                    'Type' => 'FromSubmit',             
                    'firstName' => $fname,  
                    'lastName' => $email,   
                    'emailId' => $pwd
                )
            )   
        );  
        $json = json_encode($values, JSON_UNESCAPED_SLASHES);
        $options = array(
            'headers' => array(         
              'Content-Type:application/json',
             ),
             'method' => 'POST',
             'data'=> $json,
         );  
         drupal_http_request('http://example.com', $options);
    }
Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed