I am using this decrypt and encrypt method myself, and it works perfect. You can do anything with the output.
Note: read the post and do what he says.
To run the encryption:
Using it is easy: just instantiate the class and then call EncryptToString(string StringToEncrypt)
and DecryptString(string StringToDecrypt)
as methods. It couldn't be any easier (or more secure) once you have this class in place.
In your case it would be:
SimpleAES SEAS = new SimpleAES();
string decryptedstring = SEAS.EncryptToString(model.modelitem);
To decrypt the encrypted string:
SimpleAES SEAS = new SimpleAES();
string encryptedstring = SEAS.DecryptString(model.modelitem);
EDIT | Just to pass all model items in:
List<string> EncryptedValues = new List<string>();
SimpleAES SEAS = new SimpleAES();
foreach(var modelitem in model)
{
EncryptedValues.Add(SEAS.EncryptToString(Convert.ToString(modelitem)));
}
// Do something with the list.