I have an existing database table that I have decided to encrypt and I have configured an MirgrationEncryptionProvider so it will map the previous data
var migrationProvider = new MigrationEncryptionProvider(null, new AesProvider(encryptionKey, encryptionIV));
_encryptionProvider = migrationProvider;
and now I'm calling the migration procedure when needed await _db.MigrateAsync(); so it take all properties decorated with EcryptionAttribute and applies the mapping from previous encryption to the new one.
There is a problem for default case, the plaintext columns.
The error is caused by the default decoder for string types in my cases. Knowing the it isn't encoded it should return the value that is stored on database, not to try to decode it with FromBase64String decoder that we pass.
FormatException
The format of s is invalid. s contains a non-base-64 character, more than two padding characters, or a non-white space-character among the padding characters.
Note: It work very well to pass from and ecrypted version to another one, it only the plaintext case, that is a problem in my opinion.
I have an existing database table that I have decided to encrypt and I have configured an MirgrationEncryptionProvider so it will map the previous data
and now I'm calling the migration procedure when needed
await _db.MigrateAsync();
so it take all properties decorated with EcryptionAttribute and applies the mapping from previous encryption to the new one. There is a problem for default case, the plaintext columns. The error is caused by the default decoder for string types in my cases. Knowing the it isn't encoded it should return the value that is stored on database, not to try to decode it with FromBase64String decoder that we pass.Note: It work very well to pass from and ecrypted version to another one, it only the plaintext case, that is a problem in my opinion.