Decryption using AES and CryptoAPI? When do you know KEY / SALT

Ok, so I have my own proprietary binary format. This is basically free packaging for multiple raster datasets. In any case, in the past just reading this and unpacking was an easy task. But now in the next version, XML raster data should now be encrypted using AES-256 (not my choice, and we have no choice).

Now we basically sent AES Key along with the SALT that they use so that we can modify our unpacker.

NOTE. THESE ARE NOT KEYS SIMPLY EXAMPLE:

Each of them has a length of 63 bytes of ASCII characters:

Key: "QS;x||COdn'YQ@vs-`X\/xf}6T7Fe)[qnr^U*HkLv(yF~n~E23DwA5^#-YK|]v."
Salt: "|$-3C]IWo%g6,!K~FvL0Fy`1s&N<|1fg24Eg#{)lO=o;xXY6o%ux42AvB][j#/&"

Mostly we want to use Crypt CAPPAPI to decrypt this code (I am also the only programmer here this week and it will live tomorrow, not our mistake). I looked at a simple tutorial on implementing this. Unfortunately, I can’t even find a tutorial in which they have salt and key separately. Basically, all I have now is a small function that accepts a BYTE array. Along with its length. How can i do this?

I spent most of the morning trying to make cryptoAPI heads / tails. But this is not a very good period :(

EDIT

So, I asked how they encrypt it. They use C # and use RijndaelManaged, which in my knowledge is not equivalent to AES.

EDIT2

Well, finally, it turned out exactly what was happening, and they sent us the wrong keys.

They do the following:

Padding = PKCS7 CipherMode = CBC The key is defined as a set of 32 bytes in hexadecimal format. IV is defined as a set of 32 bytes in hexadecimal format.

They took the salt when I asked them.

How difficult is it to install these things in CryptoAPI using the wincrypt.h. Header file?

+3
source share
2 answers

AES-256 256- . . 63 504 . , 63 256 (, , base64). , "" AES. (IV) Cipher-Block-Chaining, , - .

, , "SALT" IV , , CBC.

CAPI (, decrypt).

, , , . . . Stick AES.

UPDATE. ++ CAPI. 64 , 256 (256 /(4 / char) == 64 ). .

, , IV . AES/Rijndael . , TLS, . .

+4

Rijndael - AES

-5

Source: https://habr.com/ru/post/1719385/


All Articles