React Native

Security Best Practices

Secure storage, SSL pinning, obfuscation, reverse engineering protection, sensitive data

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

What is the recommended method for storing sensitive data like authentication tokens in a React Native application?

Câu trả lời

Sensitive data like authentication tokens must be stored in Keychain (iOS) or Keystore (Android) using libraries like react-native-keychain or expo-secure-store. These systems provide hardware-backed encryption and protection against data extraction even on rooted devices. AsyncStorage stores data in plain text and should never be used for sensitive information.

2

What is SSL pinning and why should it be implemented in a React Native application?

Câu trả lời

SSL pinning validates the server certificate against a known certificate or public key embedded in the application, rather than trusting only the system certificate chain. This protects against man-in-the-middle attacks even if an attacker has installed a malicious certificate on the device. Libraries like react-native-ssl-pinning or TrustKit enable implementing this protection.

3

How to protect JavaScript code in a React Native application against reverse engineering?

Câu trả lời

JavaScript code obfuscation using tools like Metro bundler, react-native-obfuscating-transformer or Hermes bytecode makes code harder to understand. Hermes compiles JavaScript to bytecode, adding a protection layer. However, obfuscation is not absolute protection - it slows down attackers but cannot completely prevent reverse engineering. Critical secrets should never be stored in client code.

4

How to handle API keys and secrets in a production React Native application?

5

What is root/jailbreak detection and how to implement it in React Native?

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

Nắm vững React Native 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í