Rijndael加密
这个加密库使用管道字符吗? 我将密钥与相应的 UserID 值一起存储在数组中,并用管道字符分隔它们。 如果库生成带有管道字符的键,那么当我稍后分割字符串时,这些键将被破坏。
does this encryption library use pipe characters? I'm storing the key in an array with the corresponding UserID value, and delimiting them with a pipe character. If the library generates keys with pipe characters, those keys will get mangled when I split the string later.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
密钥应该是随机的,因此可以顺便包含管道字符。 您应该在管道分隔字符串中将其表示为十六进制或 base-64,以避免出现不可预测的结果。
The key should be random, and so could contain pipe characters incidentally. You should represent it as hexadecimal or base-64 in your pipe-delimited string to avoid unpredictable results.
我不知道有一个名为 Rijndael 的图书馆。 我知道一种名为 Rijndael(现在为 AES)的对称密码,但该密码会加密内容 — 它不会生成密钥。
如果您指的是密码,那么您的问题不适用。 如果您指的是一段特定的代码(即一个库),那么链接会很有用,这样我们都可以看到您正在谈论哪个特定的 Rijndael 实现库。
话虽这么说,您始终可以将任何数据重新编码为,例如,base64、十六进制、二进制或您喜欢的任何没有管道字符的数据。
I don't know of a library named Rijndael. I know of a symmetric cipher named Rijndael (now AES), but the cipher encrypts stuff---it doesn't generate keys.
If you mean the cipher, your question doesn't apply. If you mean a particular piece of code (i.e. a library), a link would be useful so we can all see which particular Rijndael-implementing library you're talking about.
That being said, you can always recode any data to, say, base64, or hex, or binary, or whatever you prefer, that doesn't have a pipe character.