ProtectedString can be used to encrypt and/or decrypt a string, but it has each encryption/decryption instance.
This means an instance of ProtectedString cannot be reused to encrypt another string.
To encrypt and/or decrypt data again and again, DataProtect class will be implemented.
Code snipped(may be changed):
using(var ldp = LocalDataProtect.Create())
{
var encrypted = ldp.Encrypt(data);
}
using(var pdp = PBEDataProtect.Create(password))
{
var encrypted = pdb.Encrypt(data);
}
ProtectedStringcan be used to encrypt and/or decrypt a string, but it has each encryption/decryption instance.This means an instance of
ProtectedStringcannot be reused to encrypt another string.To encrypt and/or decrypt data again and again,
DataProtectclass will be implemented.Code snipped(may be changed):