Closed gala-s closed 2 years ago
I did some testing with previous versions and 3.1 is also affected, it looks like the initial release is the only one that writes the encrypted value to the DB.
For me the only package that worked was v1. the other two (3 and 5) were saying blank data.
The problem is relevant with "Initialize.Key" methods. He used static constructor, passed "Key" value between classes.
Thus, manipulating Initialize.Key method is the corrupted one. I solved the issue by registering GenerateEncryptionProvider as singleton with Key argument and use registered DI instance as follows:
namespace EntityFrameworkCore.EncryptColumn.Util
{
public class GenerateEncryptionProvider : IEncryptionProvider
{
private readonly string _key;
public GenerateEncryptionProvider(string key)
{
_key = key;
}
You need to compile the project from source. It works fine. The nuget-package doesn't work.
The current release writes an empty string to the database instead of the encrypted value. I was able to verify this using the example project, after upgrading that project to EncryptColumn 5.0.6.
Looking at the repository history, it looks like the issue may have been resolved here back in August, but an updated NuGet package wasn't published afterward.