Eastrall / EntityFrameworkCore.DataEncryption

A plugin for Microsoft.EntityFrameworkCore to add support of encrypted fields using built-in or custom encryption providers.
MIT License
326 stars 54 forks source link

Upgraded from 3.01 to 5 and dont know what to put in the initializationVector #62

Closed JeffreyHiscox closed 5 months ago

JeffreyHiscox commented 5 months ago

Hi

I created a project awhile back that used v3.0.1 and used the constructor that required an encryptionKey parameter only.

Just upgraded the project to .net 8 and EF.DataEncryption to v5.0.0 and see that the initializationVector is now required. As all my columns have been encrypted, how do I decrypt them using the new constructor? It can't be null or an empty byte[]

Thanks

Eastrall commented 5 months ago

Since V4, dynamic IV support has been removed. You will need to create your own EncryptionProvider to read/write your data. Check out this comment https://github.com/Eastrall/EntityFrameworkCore.DataEncryption/issues/46#issuecomment-1401939203

If you want to migrate your data to use a fixed IV, I'd suggest you to read your database with the dynamic IV encryption provider and then write with the built-in encryption provider or another custom one if you want.

JeffreyHiscox commented 5 months ago

Great, thanks for the link