Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/310.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 解密base64编码的字符串_C#_Base64_Blowfish - Fatal编程技术网

C# 解密base64编码的字符串

C# 解密base64编码的字符串,c#,base64,blowfish,C#,Base64,Blowfish,我正在使用安装工厂加密字符串: string Crypto.BlowfishEncryptString ( string Text, string Key, number LineLen = 0 ) 说明: Blowfish加密字符串并返回包含加密数据的base64编码字符串 注:Base64编码是将任意数据编码为 纯ASCII文本。这种编码的一个常见用途是发送 通过电子邮件发送文件。这是默剧演员使用的技巧之一 发送除纯ASCII文本以外的数据的标准 我写道: encrypted

我正在使用安装工厂加密字符串:

string Crypto.BlowfishEncryptString ( 
  string Text,
  string Key,
  number LineLen = 0 )
说明

Blowfish加密字符串并返回包含加密数据的base64编码字符串

注:Base64编码是将任意数据编码为 纯ASCII文本。这种编码的一个常见用途是发送 通过电子邮件发送文件。这是默剧演员使用的技巧之一 发送除纯ASCII文本以外的数据的标准

我写道:

encryptedPass = Crypto.BlowfishEncryptString("password123", "uniqueKey", 0);
它打印一个base-64字符串:

j5b+4W25ugGZxXJZ0HCFxw==
现在用C#解密密码:

使用

但是它返回null,我也没有解码base-64

编辑:

还尝试解码base-64字符串:

byte[] bytes = Convert.FromBase64String(test);
string hex = BitConverter.ToString(bytes).Replace("-", string.Empty);

Blowfish algo = new Blowfish(enKey);
string decryptedTxt = algo.decryptString(hex);

该项目页面上的一条评论说:加密的输出会随着每次使用相同输入的执行而改变。如果这是真的,这是一个可怕的河豚实现,你可能想搜索另一个。@dotNET听起来很可怕,但我坚持使用它。有出路吗?相关的问题,他们推荐了一个不同的河豚实现@bradbury9,在那里,做到了。一个糟糕的公司有两个解决方案:改变公司或离开公司。你的电话!:)该项目页面上的一条评论说:加密的输出会随着每次使用相同输入的执行而改变。如果这是真的,这是一个可怕的河豚实现,你可能想搜索另一个。@dotNET听起来很可怕,但我坚持使用它。有出路吗?相关的问题,他们推荐了一个不同的河豚实现@bradbury9,在那里,做到了。一个糟糕的公司有两个解决方案:改变公司或离开公司。你的电话!:)
byte[] bytes = Convert.FromBase64String(test);
string hex = BitConverter.ToString(bytes).Replace("-", string.Empty);

Blowfish algo = new Blowfish(enKey);
string decryptedTxt = algo.decryptString(hex);