如何检查数据是否已经加密
我在当前项目中使用 RijndaelManaged 来加密数据,有什么方法可以检查数据是否已经加密,这样我就不会对其进行两次加密?
I am using RijndaelManaged in my current project to encrypt data , is there any way tht I can check whether the data is already encrypted or not so i don't end up encrypting it twice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,没有可靠的方法可以知道您正在检查的数据是否已经加密。大多数明文都有可以检测到的偏差或模式,但这些技术不能保证普遍有效。您需要向密文(或明文)添加额外的结构,例如每个密文消息或块都以 128 位模式开头。
No, there is no reliable way to know whether the data you are examining has already been encrypted. Most plaintext has biases or patterns that can be detected, but those techniques are not guaranteed to work in general. You need to add additional structure to the ciphertext (or the plaintext), for example each ciphertext message or block begins with a 128-bit pattern.
如果数据可以被压缩,那么通常意味着尚未应用加密(或其他压缩)。
If data can be compressed, then it normally means encryption (or other compression) has not been applied.
我认为这个问题是与您所要求的非常匹配。如果该问题的答案还不够,请发表评论。
I think this question is a close match to what you are asking. Please leave a comment if the answers to that question were not enough.