Encryption at Rest and in Transit
Certificate pinning requires careful implementation. Pin the public key rather than the entire certificate so the pin survives certificate rotation. Include a backup pin for a secondary certificate authority in case the primary CA is compromised. Set up monitoring that alerts you when certificates are approaching expiry so you can issue an app update before the pin breaks. Without proper certificate pinning, a fraudster with access to a compromised CA can intercept all encrypted traffic between your app and server.
All data between the mobile app and server must be encrypted using TLS 1.2 or higher. Your server must reject connections using SSL 3.0, TLS 1.0, or TLS 1.1. Configure strong cipher suites and disable RC4, DES, and export-grade ciphers. Implement certificate pinning in your mobile app to prevent man-in-the-middle attacks. The app verifies the server certificate matches a pinned version compiled into the app, preventing interception even if a certificate authority is compromised.
For data at rest, use platform-specific encrypted storage. On Android, use EncryptedSharedPreferences and EncryptedFile APIs. On iOS, use Data Protection with NSFileProtectionComplete. Encrypt local databases with SQLCipher providing transparent AES-256 encryption. On the server, encrypt sensitive fields like BVN numbers, account numbers, and phone numbers using column-level AES-256-GCM encryption. Store encryption keys separately from encrypted data, ideally in a hardware security module or cloud key management service like AWS KMS.
Secure Key Storage on Mobile
API keys, encryption keys, and authentication tokens stored on mobile devices are vulnerable to extraction if the device is compromised. Android Keystore and iOS Keychain provide hardware-backed secure storage that protects keys even if the device operating system is compromised. On Android devices with a Trusted Execution Environment, keys stored in the Keystore never leave the hardware secure boundary.
Generate keys inside the Keystore using KeyGenParameterSpec. Never import private keys as the import process may expose key material. On iOS, use Keychain Services with kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly to protect keys with the device passcode. Never hardcode API keys in source code. Use a secure configuration server that delivers secrets to the app at runtime over an authenticated encrypted channel.
Session Management and 2FA
Session fingerprinting should validate multiple device characteristics including device model, operating system version, screen resolution, installed fonts, network carrier, and IP address geolocation. The server maintains a baseline profile of these characteristics from the initial login. If subsequent requests show a materially different profile such as a different device model or a different country location the server should trigger additional authentication steps before allowing sensitive operations like transfers or profile changes.
Use short-lived access tokens expiring within 15 minutes with refresh token rotation. Each refresh returns a new refresh token and invalidates the previous one. Implement server-side session invalidation on logout and password change. Set concurrent session limits of one to three devices per user. Session fingerprinting validates device characteristics on every sensitive request. If the fingerprint changes significantly, flag the session for additional verification.
Two-factor authentication is mandatory under the CBN Technology Risk Assessment framework. SMS OTP is most common in Nigeria but has SIM swap vulnerabilities. Implement rate limiting, 5-minute expiry, and one-time use enforcement. Authenticator app TOTP is more secure because codes are generated on-device and not transmitted. For high-value transactions above a configurable threshold, require step-up authentication with a different factor than the initial login.
Device Binding and Root Detection
Device binding links a user account to a specific device using a fingerprint combining hardware identifiers, installed apps, and system settings. The hash is stored server-side. Significant changes trigger re-authentication, email approval, or support contact. Handle legitimate changes from OS updates or factory resets with a verification flow. Implement root and jailbreak detection by checking for su binaries, test-keys build properties, Cydia installation, and debugger attachment. On Android, use Play Integrity API for server-side device integrity verification.
Transaction Signing and Security Testing
Transaction signing ensures financial transactions are authorised by the legitimate user and have not been tampered with. The app signs critical fields amount, recipient, timestamp, and nonce with a private key from the device keystore. The server verifies with the corresponding public key. The nonce prevents replay attacks. Track used nonces and reject duplicates.
The CBN Technology Risk Assessment requires regular penetration testing of all financial transaction systems. Test at least annually and after significant system changes. Cover the mobile app for insecure storage and communication, the API for injection and broken authentication, and infrastructure for misconfigurations. Integrate static analysis into your CI pipeline. Use dynamic analysis on staging environments and dependency scanning for third-party vulnerabilities. Contact SucceedHQ Innovations for a fintech security assessment.
FAQs
What encryption should fintech apps use?
TLS 1.2+ for transit, AES-256-GCM for at rest, RSA-2048 or ECC P-256 for asymmetric. Follow NIST guidelines.
How to store API keys on mobile?
Android Keystore or iOS Keychain. Never hardcode in source code or store in SharedPreferences or UserDefaults.
What is device binding?
Links account to device using hardware/software fingerprint. Changes trigger additional verification to prevent unauthorised access.
How does transaction signing work?
Signs transaction with private key from keystore. Server verifies with public key. Nonce prevents replay attacks.
What security testing is required?
Penetration testing per OWASP Mobile Top 10, SAST, DAST, API testing, CBN TRA and NDPR compliance review.