private char[] Encrypt(string content, string secretKey)
{
char[] data = content.ToCharArray();
char[] key = secretKey.ToCharArray();
for (int i = 0; i < data.Length; i++)
{
data[i] ^= key[i % key.Length];
}
return data;
}
private string Decrypt(char[] data, string secretKey)
{
char[] key = secretKey.ToCharArray();
for (int i = 0; i < data.Length; i++)
{
data[i] ^= key[i % key.Length];
}
return new string(data);
}