I have been studying various crypto attacks, and one of the attacks that I have recently studied was the padding oracle attack. Now, I mostly understand it, but there is one aspect of the padding oracle attack that different teachers from different sources have confused me about:
Let's say I have a URL:
http://somesite.com/place?ciphertext=aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd
(Assume that the ciphertext is in hex, and that 'aa' is one byte, so in total, this ciphertext consists of 32 bytes arranged into two 16 byte blocks. In this example, the first block starts at the first 'aa' and ends with the last 'bb'. Everything after that is the 2nd block of ciphertext.)
Now, I know that to start the padding oracle attack, you would add in a block of 0's as an initialization vector to this ciphertext. However, I have been getting ambiguous and inconsistent signals as to where these 0's would be added.
For example, one source made it seem as if the 0's would be added in as a prefix to the first block of ciphertext, so the above URL would become:
http://somesite.com/place?ciphertext=00000000000000000000000000000000aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd
Another source however, made it seem as if the zeroes would replace the first block of ciphertext, so the URL would become:
http://somesite.com/place?ciphertext=00000000000000000000000000000000ccccccccccccccccdddddddddddddddd
Yet, another source made it seem as if you append the zeroes to the end of the ciphertext like so:
http://somesite.com/place?ciphertext=aaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbccccccccccccccccdddddddddddddddd00000000000000000000000000000000
Which is it, or is it optional?
Also, the above method of attempting a padding oracle attack assumes that the ciphertext is present in a URL, but what if you want to decrypt a file such as a cookie or something like that? When attacking through a URL, you can get responses such as status 200 and 500 responses back from the server. However, if it is just a file on your computer that you are trying to decrypt, then what would act as the server? As far as I'm aware, if it is just a file then there is no server to give you any responses back or any "badPaddingException" errors or anything like that. This also means that there is no server that would actually know the intermediary bytes that were used in encryption. How then, would you go about decrypting a file (as opposed to a URL) using the padding oracle attack method?