假设我有一个密钥-k和纯文本P。然后我使用密钥k用AES加密P:
C=AES_k(P)
现在让我们假设我选择了另一个纯文本-P*。这个纯文本与P无关,我选择它作为我想要的任何样子。
有没有可能找到一个密钥-k*,这样当我用k*解密C时,我就会得到P*?
Meaning: D_k*( AES_k(P) ) = P*
假设我有一个密钥-k和纯文本P。然后我使用密钥k用AES加密P:
C=AES_k(P)
现在让我们假设我选择了另一个纯文本-P*。这个纯文本与P无关,我选择它作为我想要的任何样子。
有没有可能找到一个密钥-k*,这样当我用k*解密C时,我就会得到P*?
Meaning: D_k*( AES_k(P) ) = P*
我认为钥匙不一定存在。密钥定义了块的所有可能值的排列。对于128位的块大小,有(2^128)!可能的排列。对于256位密钥,有2^256个可能的密钥。这比排列的数量要少得多,所以不是每个排列都可以指定。我认为——尽管我当然无法证明,甚至无法争辩——这意味着可能没有一个可指定的排列将你选择的第二个明文映射到密文。
如果真的存在这样的排列,我想很难找到。如果这很容易的话,已知的对密码的明文攻击将是微不足道的。
这里我假设你的明文和密文P、P*和C都是128位块。
如果你的密钥k和k*有128位长度(即你使用的是AES-128),那么,以大约36.8%的概率,没有解决方案:更正式地说,如果你考虑C和P*(2256组合)的所有可能值的集合,那么对于它们中的大约e-1,没有k*使得AES_k*(P*)=C。
这源于这样的想法,即对于给定的P*值,将k*转换为AES_k*(P*)的函数应该表现为随机函数,并且从大小N的集合到相同大小N-1的平均覆盖范围。这里,对于给定的P*,大约有63.2%的128位字是用128位密钥对P*进行AES加密的可能输出。
另一方面,如果你允许k*更宽(AES也接受192位和256位密钥),那么你的方程应该有很多解k*。
无论如何,实际上找到k*(即使是192位或256位的k*)应该是不可行的,工作因子接近2128运算。能够用比这更少的工作量找到k*可能被视为AES中的一个结构性缺陷。P和k的知识毫无帮助:对于给定的128位密文C,很容易找到匹配对(P,k)。
注意:如果您采用AES并交换明文和密钥的角色,那么您将获得一个输入有限、输出为128位的哈希函数的粗略模拟。你所要求的是对该散列函数进行图像前攻击的可行性。
这对于您选择的任何纯文本来说都是不可能的。能够将密文解密为任意明文意味着完全安全(或完美保密)。
例如,如果我有密码ADGWTX,并且我知道它是使用简单的XOR和6个字母的密钥加密的,那么如果没有更多关于密钥的信息,我仍然无法破解它。因为一把钥匙会给我逃生的机会,而另一把钥匙则会给我攻击的机会。
完美的安全性是“一次性垫”(http://en.wikipedia.org/wiki/One-time_pad),但不是AES。
可以得到k*并解密C以得到明文P*,但只能用另一种类型的密码进行解密,比如vernam密码。
你可以得到k*,使得D_k*(AES_k(P))产生你的P*。
you just do: P* ^ C to get your k* then if you decrypt: k* ^ C you get P* (assuming both C and P* are of equal size)
但是如果你的P*的大小小于C,那么它会产生一个重复的P*
^:按位异或
我不确定这是否是你想要的,你没有提到你想用AES解密它。
Hey SO ers, I m making a C#/WPF app that needs to access a number of tables to generate some of the xaml code I will use in the app. The tables will also contain some floating point numerical data as ...
I want to encrypt individual contacts stored by the Contacts application on Android based on user s preference. So, I am thinking I ll have to hook/extend the Contacts application before the it stores ...
I want to email users an encrypted file from a Django Backend Script (running through manage.py) on Ubuntu. How can I encrypt the data so that it is unreadable by 3rd parties who might intercept or ...
Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...
I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...
I though it ll be interesting to look at threads and queues, so I ve written 2 scripts, one will break a file up and encrypt each chunk in a thread, the other will do it serially. I m still very new ...
I m trying to convert this piece of code from PHP to C#. It s part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = ...
I ve been stuck trying to arrive at a best solution for this for a while. I know that an initialization vector has to be unique for each item being encrypted. So if I m encrypting an address and I ...