English 中文(简体)
• 如何将铺设钥匙和四级的阵列改成里贾德尔的旁观阵列
原标题:How to convert string key and IV to byte arrays for Rijndael

文件说,“如果你使用以下价值观,那么你将取得这一结果”。

Block Size: 128 Cipher Mode: CBC Padding Mode: Zeros

<<>strong>Key: BTikvHBatPdAtgT3317QIQqGFY25WpIz

<>四>:

www.un.org/spanish/ecosoc 价值待定:2008-06-02 13:28:45,Statements,1234567,06/01/2008,06/01/2008,0

而这种加密结果应如何根据开发商指南来看待所有这些价值。

b97f3985245be1065604c5808cebaa2e15813bf938cfaa3c198fd464565c13ced7c91ac6 b68326ce5ed5e81cb7de81acb9fcd1b1636127efbac3203da5bdccea

然而,由于某种原因,我无法取得这一结果,这是我用来描述这一结果的法典,但首先和以后,它给我留下了与你可能看到的在该问题的深层结果上出现的变化相同的特征。

这是法典,以下是新产出:

public static void Main(string[] args)
{
  RijndaelManaged rij = new RijndaelManaged();
  rij.Mode = CipherMode.CBC;
  rij.Padding = PaddingMode.Zeros;
  rij.Key = ASCIIEncoding.UTF8.GetBytes("BTikvHBatPdAtgT3317QIQqGFY25WpIz");
  rij.IV = ASCIIEncoding.UTF8.GetBytes("a5Sg4U9m11Mw2tIZ");
  ICryptoTransform transform = rij.CreateEncryptor();

  byte[] data = Encoding.ASCII.GetBytes("2008-06-02 13:28:45,Statements,1234567,,06/01/2008,06/01/2008,0");
  byte[] result = transform.TransformFinalBlock(data, 0, data.Length);
  Console.WriteLine(ByteArrayToString(result));
}

public static string ByteArrayToString(byte[] ba)
{
  StringBuilder hex = new StringBuilder(ba.Length * 2);
  foreach (byte b in ba)
    hex.AppendFormat("{0:x2}", b);
  return hex.ToString();
}

My output :

b97f3985245be1065604c5808cebaa2e15813bf938cfaa3c198fd464565c13ced7c91ac6b68326ce5ed5e81cb7de81ac

注:随着我提出这个问题,我需要更新,找到更好的解决办法,但新问题现在就产生了。

最佳回答

你谈论的是你的产出中的超常性质——实际上,你所公布的产出是编码的,因此,你也应努力将你的标记编码编码到海里,正如以下解释:here

Edit:

我现在就这样说。 您需要补充Close(>>>,无论是流体还是作者――采用CBC模式,如果删除,最后一块块就不必产出。 下一个问题是,如果你这样做,那么,你的产出与你所期望的产出相比仍然略有不同。 因此,如果你把你的榜样“西边”加以加密,你将:

2008-06-02 13:28:45,Statements,1234567,,06/01/2007,06/01/2007,0

这与你的案文不同,因为到2008年底,你有2007年。 如果你确定这一点并适当结束工作,你最终将获得与例如相同的产出。

问题回答

这一关键和四位你们都像第64条那样看待......。

rij.Key = Convert.FromBase64String("BTikvHBatPdAtgT3317QIQqGFY25WpIz");
rij.IV = Convert.FromBase64String("a5Sg4U9m11Mw2tIZ");




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签