简体   繁体   English

Android Realm数据库安全性

[英]Android Realm database Security

Simple question. 简单的问题。 Is Realm database safe? Realm数据库安全吗? Is there any way to receive data outside of the application? 有没有办法在应用程序之外接收数据? If not: 如果不:

I have very sensitive data, that I have to remember - How to keep them secure? 我有非常敏感的数据,我必须记住 - 如何保证它们的安全?

The Realm file can be stored encrypted on disk by passing a 512-bit encryption key (64 bytes) to RealmConfiguration.Builder.encryptionKey(): 通过将512位加密密钥(64字节)传递给RealmConfiguration.Builder.encryptionKey(),可以将Realm文件加密存储在磁盘上:

byte[] key = new byte[64];
new SecureRandom().nextBytes(key);
RealmConfiguration config = new RealmConfiguration.Builder(context)
  .encryptionKey(key)
  .build();

Realm realm = Realm.getInstance(config);

This ensures that all data persisted to disk is transparently encrypted and decrypted with standard AES-256 encryption. 这可确保使用标准AES-256加密对所有持久保存到磁盘的数据进行透明加密和解密。 The same encryption key must be supplied each time a Realm instance for the file is created. 每次创建文件的Realm实例时,必须提供相同的加密密钥。

See below link for a complete example of how to securely store keys between runs in the Android KeyStore so that other applications cannot read them: 有关如何在Android KeyStore中的运行之间安全存储密钥的完整示例,请参阅以下链接,以便其他应用程序无法读取它们:

https://github.com/realm/realm-java/tree/master/examples/encryptionExample https://github.com/realm/realm-java/tree/master/examples/encryptionExample

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM