# Is it possible to recover the key to a decrypted file? [duplicate]

Is it possible to recover the key to a decrypted file if you have the initialization vector and it uses RijndaelManaged in CBC mode? If so how?

The file I want to recover the key from is a xml that looks like this without encryption. It has a xml element called Test.

<?xml version="1.0" encoding="utf-8"?>
<Test />


When it is encrypted with the key stackoverflow (73868cb1848a216984dca1b6b0ee37bc = md5 hash) and the initialization vector below, the file look like this ¥4!¬Hw[î!71ôtž|!¢¬TÞ;u?þª-†•ÈÏ‰eßŽKtSsbZ®ÕµR©Ù«í‹:

Initialization vector:

byte[] iv = new byte[]
{
55, 66, 77, 192, 57, 100, 11, 111,
25, 86, 96, 66, 22, 122, 133, 43
};


Is it possible to reverse the key from that or are it bulletproof?

• No ${}{}{}{}{}$ Apr 21 '19 at 21:04
• are you sure?? xD @kelalaka Apr 21 '19 at 21:56
• Depends on the encryption mode. If the mode has a relationship between the key and IV (i.e. it is a very bad mode you shouldn't use) then maybe. Question as stated does not have enough information, but if the encryption was done using sane parameters and modes then no. Apr 21 '19 at 23:01
• More duplicates: crypto.stackexchange.com/q/1512, crypto.stackexchange.com/q/63883 Apr 22 '19 at 2:01
• it uses CBC mode and padding value PKCS7 is that going to make a differents? :) @puzzlepalace Apr 22 '19 at 11:33