如果您不希望出现重复的结果,欧洲央行是安全的选择吗? [英] Is ECB a safe option if you don't expect duplicate results?

查看:104
本文介绍了如果您不希望出现重复的结果,欧洲央行是安全的选择吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Rijndael-256加密文本的较长段落(在此之前,文本已被压缩并转换为base64).

I want to encrypt long paragraphs of text using Rijndael-256 (the text has been compressed and converted to base64 before this).

两者极不可能相同.但是如果碰巧的话,是否可以在文本的开头或结尾添加随机密钥来保护它(无论它们是否相同),以防万一用户写相同的文本?

It is very unlikely for the two to be the same. But if they happen to be, would adding a random key to the start or end of the text secure it (regardless of whether they're the same), just in case users write the same text?

如果我确保没有结果是100%相同,那么如果您不会得到重复的结果,欧洲央行是否安全?

If I make sure that no results are 100% the same, is ECB safe if you won't get duplicate results?

还是这样:(使用base64 ...不准确,仅是示例)

Or is it like this: (using base64... not accurate, just an example)

_Hello world_ = ahjkIOn25o

_To echo "Hello world,"_ = qw90klnN2_ahjkIOn25o_kL3

_Hello world is the_ = _ahjkIOn25o_hjAB27

因此,如果某人在其文本中隐藏了一个短语,那么无论文本中还有其他内容还是该短语在文本中的位置,该短语始终会为该片段输出相同的ECB?

So if someone has a phrase hidden inside their text, it would always output the same ECB for that piece, no matter what else is in the text, or the phrase's position in the text?

推荐答案

我建议使用CBC之类的东西.您要做的就是添加IV.

I would recommend to use something like CBC. All you will have to do is to add IV.

因此,如果某人在其文本中隐藏了一个短语,那么无论文本中还有其他内容还是该短语在文本中的位置,它始终会为该片段输出相同的ECB?

So if someone has a phrase hidden inside their text, it would always output the same ECB for that piece, no matter what else is in the text, or the phrase's position in the text?

两个完全相同的明文块将变为完全相同的密文块.

Two exactly same plaintext block will become exactly same ciphertext blocks.

因此,这取决于隐藏的短语有多长时间以及其在块内的位置.仅当块的全部内容相同时,结果才会相同.

So, it depends on how long the hidden phrase is and how it's positioned inside of a block. Only if the whole content of the block is that same, the result will be the same.

我想说这更适用于两种情况:

I would say it's more applicable for two cases:

  • 您有大量的结构化数据(例如图像或视频)
  • 您使用同一密钥来加密多条消息(这将转换为大量数据).

这两种情况都可能使攻击者弄清楚您的内部结构.

Both this case may allow attacker to figure out something about your internal structures.

我建议您看一下: http://en.wikipedia .org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 它显示了ECB的问题所在.

I recommend to take a look at this: http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 It shows what the problem with ECB.

一般来说,使用其他模式比

Generally speaking, it's easier to use another mode than to

  • 解决欧洲央行的弱点
  • 担心您是否考虑了所有可能的情况.

这篇关于如果您不希望出现重复的结果,欧洲央行是安全的选择吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆