I'm working on a winforms application that let the user fill in account and password information in a datagridview, the datasource is a datatable which will be connected to a mysql server using the .net mysql connector.
When the user saves the datatable the data needs to be encrypted to the mysql database, so incase someone hacks into the mysql server the data is useless.
For encrypting and decrypting I use a class called SimpleAES (Simple insecure two-way "obfuscation" for C#)
This works great for textboxes and such, but how can I loop thru a datagridview to encrypt all the values given by the user?
I tried the following.
private void encryptAccounts()
{
SimpleAES simpleAES1 = new SimpleAES();
string password;
password= dataGridViewAccounts[4,0].Value.ToString();
dataGridViewAccounts[4,0].Value = simpleAES1.EncryptToString(password);
}
This will only encrypt the password for the first row, how can I create a loop for every row