I'm using Keychain
to permit login through TouchID
in a remote app. My concern is about an attacker setting a breakpoint in a jailbreak device and recovering the username and password, I tried this approach to let the info the less time possible on memory.
I'd like to know if I need this level of paranoia and if I'm using the right approach.
KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc]
initWithIdentifier:@"MyAppLogin" accessGroup:nil];
NSString *password = [keychainItem objectForKey:(__bridge id)(kSecValueData)];
NSString *username = [keychainItem objectForKey:(__bridge id)(kSecAttrAccount)];
if (!username || !password) {
self.layoutState = kLayoutStateNormal;
return;
}
// forget everything you know about my password
keychainItem = nil;
password = nil;
username = nil;