How to save the password of an iPhone application

Source: Internet
Author: User
Tags key string

IPhoneApp saves user passwordSecurityThe method is described in this article, asIPhoneDevelopers, 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 is also a Keychain in the iPhone. users who have used the PushFix cracking package (that is, the hotfix push tool) should still be impressed.

// Obtain the password

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.

C code

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

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

Summary:IPhoneApp saves user passwordSecurityThe content of the method has been introduced. I hope this article will help you!

Related Article

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.