iOS

Security & Encryption

Advanced Keychain, CryptoKit, SSL Pinning, biometric auth, secure coding, ATS

20 câu hỏi phỏng vấn·
Senior
1

Which iOS mechanism should be used to securely store sensitive authentication tokens?

Câu trả lời

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.

2

Which Keychain attribute ensures data remains inaccessible while the device is locked?

Câu trả lời

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.

3

Which CryptoKit class should be used for AES-256 symmetric encryption?

Câu trả lời

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.

4

What is the main advantage of asymmetric encryption over symmetric encryption?

5

What is the fundamental difference between hashing and encryption in security?

+17 câu hỏi phỏng vấn

Nắm vững iOS cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí