Recall & Review
beginner
What is the Keychain in iOS?
The Keychain is a secure storage system provided by iOS to safely store small pieces of sensitive data like passwords, tokens, or keys. It encrypts data and protects it with the device's security features.
Click to reveal answer
beginner
Which Swift framework do you use to access the Keychain?
You use the Security framework in Swift to access the Keychain. It provides functions to add, update, delete, and query secure items.
Click to reveal answer
intermediate
What is the purpose of the kSecClass attribute when working with Keychain?kSecClass specifies the type of item you want to store or query in the Keychain, such as a generic password, internet password, certificate, key, or identity.Click to reveal answer
intermediate
How do you ensure that a Keychain item is only accessible when the device is unlocked?
You set the kSecAttrAccessible attribute to a value like kSecAttrAccessibleWhenUnlocked. This restricts access to the item only when the device is unlocked, enhancing security.
Click to reveal answer
beginner
Why should you avoid storing large data in the Keychain?
The Keychain is designed for small pieces of sensitive data. Storing large data can slow down access and is not efficient. For large data, use secure file storage or databases with encryption.
Click to reveal answer
Which iOS framework provides access to the Keychain?
✗ Incorrect
The Security framework is used to interact with the Keychain for secure storage.
What does the kSecAttrAccessibleWhenUnlocked attribute do?
✗ Incorrect
kSecAttrAccessibleWhenUnlocked restricts access to the Keychain item to when the device is unlocked.
Which type of data is best suited for storage in the Keychain?
✗ Incorrect
Keychain is designed for small sensitive data like passwords and tokens.
What is the main benefit of using Keychain over UserDefaults for sensitive data?
✗ Incorrect
Keychain encrypts data and uses device security, making it safer than UserDefaults for sensitive information.
Which attribute specifies the type of item stored in the Keychain?
✗ Incorrect
kSecClass defines the class of the Keychain item, like generic password or key.
Explain how you would securely store a user password using the iOS Keychain.
Think about the attributes needed to add an item to the Keychain.
You got /5 concepts.
Describe the advantages of using Keychain over other storage options for sensitive data on iOS.
Consider security and data protection features.
You got /5 concepts.