0

Using Realm Swift 0.96.3:

I am having problems encrypting the Realm database and I am using the same exact code example to generate the key as in the example provided by Realm (https://github.com/realm/realm-cocoa/tree/master/examples/ios/swift-2.1/Encryption). I am able to open the file the Realm Browser still. I also tried writeCopyToPath(_:encryptionKey:) and opened it in a completely different project without providing an encryption key and it was able to be read and write to it.

I have read the stackOverflow answers: SWIFT - Realm db encryption not working Swift - encrypted realm db can still be accessed without key

These answers have not helped me as of yet. Is there anything else that I can try at this point? Thank you for your help.

Community
  • 1
  • 1
joanna cheung
  • 161
  • 3
  • 9
  • If my answer shouldn't help, could you add to your question the concrete code you use to setup your `Realm.Configuration`? – marius Dec 11 '15 at 15:42

1 Answers1

1

Have you set REALM_DISABLE_ENCRYPTION=YES in your applications environment variables? If so, you'd need to remove that, so that the encryption takes effect. It used to be helpful to set that for debugging until the latest release, because the way the encryption worked interfered with LLDB and limited your debugging possibilities.

marius
  • 7,766
  • 18
  • 30
  • Thank you so much this worked :). I didn't realize writeCopyToPath(_:encryptionKey:) would be affected by this setting. – joanna cheung Dec 12 '15 at 09:39