Security & Encryption
Advanced Keychain, CryptoKit, SSL Pinning, biometric auth, secure coding, ATS
1Which iOS mechanism should be used to securely store sensitive authentication tokens?
Which iOS mechanism should be used to securely store sensitive authentication tokens?
답변
Keychain is iOS's native secure storage system, designed specifically for sensitive data. It automatically encrypts data and manages access according to defined control policies. UserDefaults should never be used for secrets as it stores data in plaintext. Keychain also offers advanced features like biometric access and secure iCloud synchronization.
2Which Keychain attribute ensures data remains inaccessible while the device is locked?
Which Keychain attribute ensures data remains inaccessible while the device is locked?
답변
kSecAttrAccessibleWhenUnlocked ensures data can only be accessed when the device is unlocked. This provides protection even if Keychain is consulted via a background process. This value is recommended by Apple for sensitive tokens. Other options like WhenUnlockedThisDeviceOnly provide additional protection by preventing iCloud synchronization.
3Which CryptoKit class should be used for AES-256 symmetric encryption?
Which CryptoKit class should be used for AES-256 symmetric encryption?
답변
SymmetricKey in CryptoKit manages symmetric keys while AES.GCM (Galois/Counter Mode) performs authenticated encryption. GCM is preferred as it provides both confidentiality and authentication, preventing manipulation attacks. This approach is more secure than ChaCha20Poly1305 in contexts not requiring extreme performance on older devices.
What is the main advantage of asymmetric encryption over symmetric encryption?
What is the fundamental difference between hashing and encryption in security?
+17 면접 질문