小编MRK*_*MRK的帖子

如何加密可能包含非 64 位字符的字符串

更新:问题是我犯了一个错误,否则两个 Cods(下面和PS上的那个都是正确的)但仍然感谢 @Luke Park 的精彩回答,我学到了一些新东西。

我对加密/解密算法不熟悉,因此我在网上搜索并找到了这个类:

在 C# 中加密和解密字符串

代码是:(我在Decrypt方法中添加了一个 Try/Catch,以防密码错误return "";

using System;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Linq;

namespace EncryptStringSample
{
    public static class StringCipher
    {
        // This constant is used to determine the keysize of the encryption algorithm in bits.
        // We divide this by 8 within the code below to get the equivalent number of bytes.
        private const int Keysize = 256;

        // This constant …
Run Code Online (Sandbox Code Playgroud)

.net c# encryption base64 winforms

0
推荐指数
1
解决办法
6804
查看次数

标签 统计

.net ×1

base64 ×1

c# ×1

encryption ×1

winforms ×1