我的应用程序有登录表单。它关于汇款。我使用Web服务发送和接收用户名和密码。我应该使用什么样的加密机制。我应该如何使用它。我的代码就像下面的
email=emailTextField.text; //[email encodeWithCoder:] password=passwordTextfield.text; NSURL *url2 = [NSURL URLWithString: [NSString stringWithFormat:@"http:MY URL Email=%@&Password=%@",email,password]]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url2];[request setHTTPMethod:@"GET"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; NSString *authStr = [NSString stringWithFormat:@"%@:%@", @"administrator", @"password"]; NSData *authData = [authStr dataUsingEncoding:NSUTF8StringEncoding]; NSString *authValue = [NSString stringWithFormat:@"Basic %@", [authData base64EncodedStringWithOptions:0]]; NSLog(@"%@",authValue);// [request setValue:authValue forHTTPHeaderField:@"Authorization"]; [request setURL:url2]; NSLog(@"%@",url2); NSError *error; NSURLResponse *response; NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSLog(@"Data is %@",data);
答案 0 :(得分:1)
表单就像你不需要加密的html表单你必须有一个SSL连接(https://),之后它将在安全连接上传输。
答案 1 :(得分:0)
我会使用RNCryptor为pwd执行AES加密,并使用session_token
发送它data = ENCRYPTED_PWD | TOKEN