Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypted Realm unable to open in Windows #1581

Closed
q-amir opened this issue May 11, 2023 · 8 comments
Closed

Encrypted Realm unable to open in Windows #1581

q-amir opened this issue May 11, 2023 · 8 comments

Comments

@q-amir
Copy link

q-amir commented May 11, 2023

Describe the bug
Unable to open encrypted realm on Windows

To Reproduce
Steps to reproduce the behavior:

  1. Open Realm Studio on Windows with version 14.03 / 14.02
  2. Open any encrypted realm file
  3. Enter the encryption key
  4. And you will see the same error as the screenshot below

Expected behavior
I should be able to see all my data in the realm db. It's work well on my macbook but not on my windows pc

Screenshots
image

Versions:

  • OS:Windows
  • Studio Version 14.03 / 14.02
@kneth
Copy link
Member

kneth commented May 11, 2023

@q-amir Thank you for reporting.

It is possible for you to test using node.js on Windows using a simple script:

const key = new Int8Array([ /* your key */  ] );
let realm = new Realm({ path: "name-of-your-realm-file", encryptionKey: key });
console.log(`Schema: ${realm.schema.length}`);
realm.close();

@kneth
Copy link
Member

kneth commented May 11, 2023

@q-amir Another question: was the encrypted Realm file created on a non-Windows platform?

@q-amir
Copy link
Author

q-amir commented May 12, 2023

@q-amir Another question: was the encrypted Realm file created on a non-Windows platform?

@kneth Yes. I generate it by using Jenkins in my macbook

@q-amir Thank you for reporting.

It is possible for you to test using node.js on Windows using a simple script:

const key = new Int8Array([ /* your key */  ] );
let realm = new Realm({ path: "name-of-your-realm-file", encryptionKey: key });
console.log(`Schema: ${realm.schema.length}`);
realm.close();

I will try this. let you know.

@q-amir
Copy link
Author

q-amir commented May 12, 2023

@q-amir Thank you for reporting.

It is possible for you to test using node.js on Windows using a simple script:

const key = new Int8Array([ /* your key */  ] );
let realm = new Realm({ path: "name-of-your-realm-file", encryptionKey: key });
console.log(`Schema: ${realm.schema.length}`);
realm.close();

@kneth I just run the simple script and it's failed.
Here is the error msg
Failed to open the Realm: Error [RealmError]: Failed to open Realm file at path 'D:\Projects\Tests\TestMasterdata\chmd.realm': Realm file decryption failed (Decryption failed)

@kneth
Copy link
Member

kneth commented May 12, 2023

It might be a duplicate of #1373. Encrypted Realm file might be slightly dependent on the platform where they are created. My little script above will tell us if it is the case.

We have an open issue to fix it.

@q-amir
Copy link
Author

q-amir commented May 12, 2023

It might be a duplicate of #1373. Encrypted Realm file might be slightly dependent on the platform where they are created. My little script above will tell us if it is the case.

We have an open issue to fix it.

@kneth I see. seems like I need to wait for an update. Is there any other way for me to make my realm db more secure?

@kneth
Copy link
Member

kneth commented May 12, 2023

Is there any other way for me to make my realm db more secure?

Our encryption is pretty good - the issue is how to share it across platforms.

Most operating systems today offer encryption of the file system, which is a good option for the case the device is lost. It is a more general remark unrelated to Realm 😄

@kneth
Copy link
Member

kneth commented Jul 14, 2023

I am closing the issue due to no reply back. Please create a new issue if you have new observations to share.

@kneth kneth closed this as completed Jul 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants