Make encrypted Realms cross platform compatible

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      The way Realm encryption works is dependent on the size of a memory page - usually that's different between 32bit and 64bit devices (or more specifically the architecture of the app, not the device).

      We should switch to a fixed size as part of core 6.
      Historically the size had to be a multiple of the mprotect granularity (which isn't actually the same thing as the page size on ios) and we didn't want to change it for 32-bit for compatibility reasons, but that's no longer applicable.
      The hmac makes it so that we can detect the page size used: just try to decrypt with both 4k and 16k page sizes, and whichever one matches the signature is correct.

      The issue is experienced in e.g. Studio: https://github.com/realm/realm-dotnet/issues/1779#issuecomment-431079582

              Assignee:
              Unassigned
              Reporter:
              Brian Munkholm (Inactive)
              Archiver:
              Marc Greenfield

                Created:
                Updated:
                Resolved:
                Archived: