0

I'm trying decrypt whatup db file (which I copied to my PC, and run from my PC, under linux).

The initialize vector and key are:

private byte[] key = { (byte) 141, 75, 21, 92, (byte) 201, (byte) 255,
        (byte) 129, (byte) 229, (byte) 203, (byte) 246, (byte) 250, 120,
        25, 54, 106, 62, (byte) 198, 33, (byte) 166, 86, 65, 108,
        (byte) 215, (byte) 147 };


private final byte[] iv = { 0x1E, 0x39, (byte) 0xF3, 0x69, (byte) 0xE9, 0xD,
        (byte) 0xB3, 0x3A, (byte) 0xA7, 0x3B, 0x44, 0x2B, (byte) 0xBB,
        (byte) 0xB6, (byte) 0xB0, (byte) 0xB9 };

And when I'm running this code:

  Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
  SecretKeySpec secret = new SecretKeySpec(key, "AES");
  IvParameterSpec vector = new IvParameterSpec(iv);
  cipher.init(Cipher.DECRYPT_MODE, secret, vector);

I'm getting exception on the init function: "java.security.InvalidKeyException: Illegal key size"

I used this post:

Get all messages from Whatsapp

What is wrong ?

user3668129
  • 4,318
  • 6
  • 45
  • 87
  • Google InvalidKeyException Illegal Key Size and the first three hits all answer your question. (24 bytes is 192 bits and 192 is more than 128, which is the limit for Oracle/Sun Java before 9 or 8u151.) – dave_thompson_085 Nov 14 '17 at 05:03
  • so what is the right key ? (in order to decrypt whatup DB) ? – user3668129 Nov 14 '17 at 05:07

1 Answers1

0

I guess The JDK key size which does not allow you to encrypt with key whose size is more than 128 bits.