Swift - encrypted realm db can still be accessed without key

最后都变了- 提交于 2019-12-25 14:05:07

问题


I probably do not understand the encryption of Realm propably and hope someone can help.

I created a Realm database with encryption according to this example: https://github.com/realm/realm-cocoa/blob/master/examples/ios/swift-2.0/Encryption/ViewController.swift

 let configuration = Realm.Configuration(encryptionKey: "31234567890123456789012345678901234567890123456789012345678901234".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false))
 let realm = try! Realm(configuration: configuration)

However after I run my script I can still access & change the Realm file in Realm browser. I expected that the Realm file is encrypted and users cannot read the realm file without decrypting it with the correct password.

I already read question "SWIFT - Realm db encryption not working" but it did not answer my question.

How can I protect my realm file that nobody can read/write Objects from and to it without knowing the encryption key ?

Thanks, Tim

来源:https://stackoverflow.com/questions/32908948/swift-encrypted-realm-db-can-still-be-accessed-without-key

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!