Closed archseer closed 4 years ago
I think a new cipher is the correct solution in this case. You can probably implement it locally in your project, using Cloak.Ciphers.AES.GCM as a guide.
In Cloak 2.0, we can change the default IV length while providing an upgrade path.
This has been partially addressed by #95. In Cloak 2.0, the default iv length will be 12-bytes.
For now, you can switch to 12-byte IVs like so:
ciphers: [
default: {Cloak.Ciphers.AES.GCM, tag: "AES.GCM.V2", key: <<...>>, iv_length: 12},
retired: {Cloak.Ciphers.AES.GCM, tag: "AES.GCM.V1, key: <<...>>, iv_length: 16}
]
This will cause your vault to gradually re-encrypt all your data to 12 byte IVs as it is read and written.
Linked to:
I've been working on an interop module for decrypting cloak fields from rust. The nonce/IV is set to 16 bytes, but rust libraries have it specifically hardcoded to 12 bytes (support was removed even).
Related discussion here: https://github.com/siacs/Conversations/issues/2578
&
I'm not sure exactly how to patch this without breaking compatibility though. Maybe forking the module and specifying a different tag would be the way to go?