我似乎无法找到使用AES 128位加密的一个很好的清洁示例.
有没有人有一些示例代码?
我有以下代码,我希望看到它作为oneliner.但是,由于我对C#很新,我目前还不知道如何做到这一点......
码:
static string ROT13 (string input)
{
if (string.IsNullOrEmpty(input)) return input;
char[] buffer = new char[input.Length];
for (int i = 0; i < input.Length; i++)
{
char c = input[i];
if (c >= 97 && c <= 122)
{
int j = c + 13;
if (j > 122) j -= 26;
buffer[i] = (char)j;
}
else if (c >= 65 && c <= 90)
{
int j = c + 13;
if (j > 90) j -= 26; …Run Code Online (Sandbox Code Playgroud)