Eastrall / EntityFrameworkCore.DataEncryption

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

Restore Database into another server #21

Closed ekhtiari closed 3 years ago

ekhtiari commented 3 years ago

Hi . thanks for great package. I have a question I add your package to my site . it's work correctly in my system but after backup database and publish on my server I get error 500 . how can I backup and restore generate key on my system ?

Eastrall commented 3 years ago

Hi.

You should use the same generated key that you've used to feed your database. Meaning that, if you create your database you the key "XYZ", insert some data and then export your data to another server, you will need to use the exact same key to decrypt the data.

Of course, once you genearte your key, you will need to store it somewhere so you don't loose it, in order to decrypt your data when you change servers. Otherwise, you will loose your data.

ekhtiari commented 3 years ago

Thanks for comment . I think that key store in windows ( registery) or store in database like always encrypt method in SQL Server .

have a nice time ,