I assume that your plaintexts and ciphertexts P, P * and C are 128-bit blocks.
If your keys k and k * are 128-bit long (i.e., you use AES-128), then with a probability of about 36.8% there is no solution: more formally, if you consider the set of all possible values ββfor combinations C and P * (2 256 ), then for approximately e -1 of them there does not exist k * such that AES_k * (P *) = C.
This follows from the fact that for a given value of P *, a function that converts k * to AES_k * (P *) should behave as a random function, and a random function from a set of size N to a set of identical size N has an average coverage of 1 -1 sets of recipients. Here, for a given P *, there are about 63.2% of 128-bit words, which are possible outputs of P * AES encryption with a 128-bit key.
On the other hand, if you allow k * to be wider (AES also accepts 192-bit and 256-bit keys), then there should be many k * solutions in your equation.
In any case, in fact, the search for k * (even a 192-bit or 256-bit k *) should not be feasible, while the coefficient of operation is close to operations 2 128 . The ability to find k * with less work than can be seen as a structural flaw in AES. Knowing P and k does not help in any way: for a given 128-bit encrypted text C, it is easy to find matching pairs (P, k).
Note: if you take AES and change the roles of plaintext and key, then you get a rough emulation of a hash function with limited input and 128-bit output. What you are asking for is the possibility of attacking the prefix of this hash function.
source share