相关疑难解决方法(0)

在C#中使用AES加密

我似乎无法找到使用AES 128位加密的一个很好的清洁示例.

有没有人有一些示例代码?

c# cryptography aes rijndaelmanaged

118
推荐指数
7
解决办法
34万
查看次数

可以在一行中写一个ROT13吗?

我有以下代码,我希望看到它作为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)

c# encryption rot13

5
推荐指数
3
解决办法
7116
查看次数

标签 统计

c# ×2

aes ×1

cryptography ×1

encryption ×1

rijndaelmanaged ×1

rot13 ×1