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.
- // Obtain the password
-
- + (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error;
-
- // Save the password
-
- + (Void) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName:
- (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error;
-
- // Delete the password
-
- + (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!