encode secondary_password with base64 to avoid null character issues