redbear / Duo

Resources for the RedBear Duo IoT development board.
http://redbear.cc/duo
228 stars 107 forks source link

The Password verification value comes out to be wrong #43

Open tajiknomi opened 6 years ago

tajiknomi commented 6 years ago

Hi, I have encrypted a file using Winzip with AES-128 encryption. The password i applied is "12345678". The Salt value stored in the encrypted zip archive is 8 bytes i.e. [0xa4 0x94 0x72 0xce 0x84 0x16 0x84 0x05].

Now i tried using the following:

           fcrypt_ctx ctx;
    int mode = 1;
    unsigned char pwd[8] = {'1','2','3','4','5','6','7','8'};
            unsigned char salt[8] = {0xa4,0x94,0x72,0xce,0x84,0x16,0x84,0x05};
    unsigned char pwd_ver[2] = { 0 };

           fcrypt_init(mode,pwd,8,salt,pwd_ver,&ctx);
           printf("Password Verifier : 0x%02x 0x%02x\n",pwd_ver[0],pwd_ver[1]);

The output i.e. "Password Verifier" comes out to be [0XEA,0X43] which is not the same Password verifier i extracted from the ZIP archive [0X97,0XB1] using the same SALT and PASSWORD. Have i missed anything ?