SoFunction
Updated on 2025-03-06

C# implements the simplest text encryption method


private char[] TextEncrypt(string content, string secretKey)
{
    char[] data = ();
    char[] key = ();

    for (int i = 0; i < ; i++)
    {
        data[i] ^= key[i % ];
    }

    return data;
}

private string TextDecrypt(char[] data, string secretKey)
{
    char[] key = ();

    for (int i = 0; i < ; i++)
    {
        data[i] ^= key[i % ];
    }

    return new string(data);
}