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
- + (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:IPhoneApp saves user passwordSecurityThe content of the method has been introduced. I hope this article will help you!