Detailed explanation of iPhone development and saving User Password Security

Source: Internet
Author: User

IPhone DevelopmentSave User PasswordSecurityThe method is described in this article,SecurityThe problem is very important. First, let's take a look at how this article solves it. As an iPhone developer, you needSecurityResponsible. How do you save your password?

Directly saved to plist?

Encryption? AES? DES? Can you ensure that your code is not decompiled to get your encryption Key?

This is too much for Apple. I Googled it and Chinese developers didn't even notice this problem.

In the Apple system, there is a program called "Keychain". It is not only used for your application for development certificates. Haha. It can store passwords!

This is also the best solution for Apple to save the password.

There are also keychains in iPhone development. users who have used the PushFix cracking package (that is, the hotfix push tool) should still be impressed.

Use native Security. the framework can access and read/write key strings, but can only be performed on a real machine. The simulator will fail. on Github, there is a very encapsulated class to implement this function, so that you can access the key string on both the simulator and the real machine.

 
 
  1. // Obtain the password
  2.  
  3. + (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
  4.  
  5. // Save the password
  6.  
  7. + (Void) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName:
  8. (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
  9.  
  10. // Delete the password
  11.  
  12. + (Void) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;

Class address: http://github.com/ldandersen/scifihifi-iphone/tree/master/security

Summary: DetailsIPhone DevelopmentSave User PasswordSecurityThe content of this method has been introduced. I hope this article will help you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.