Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to decrypt pbkdf2 encrypted text without knowing the IV
    primarykey
    data
    text
    <p>I am trying to decrypt an encrypted text. I have the salt value, iteration count and key length. But i don't have the initialization vector (IV) value, how can i go about and decrypt this. I also have secret key.</p> <p>For time being I am using some random IV value whose size is 16 bytes. But still i am not able to decrypt the value properly. Can anyone please help as i am stuck with this for a long time?</p> <hr> <p>Below are the values which were given to me.</p> <pre><code>salt= EW0h0yUcDX72WU9UiKiCwDpXsJg=, Iteration=128,Keylenght=16. MasterKeyName="Passphrase1", MACMethod algo = hmac-sha1, MACKey="jq/NdikC7AZf0Z+HEL5NrCICV8XW+ttzl/8687hVGHceoyJAaFws+111plQH 6Mlg" encrypted kae = "pM7VB/KomPjq2cKaxPr5cKT1tUZN5tGMI+u1XKJTG1la+ThraPpLKlL2plKk6vQE" and valuemac="lbu+9OcLArnj6mS7KYOKDa4zRU0=". Secret key = "xxxxxxxxxxx". </code></pre> <hr> <p>Below is the code which I am using to decrypt.</p> <pre><code>SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); KeySpec spec = new PBEKeySpec(secretkey.toCharArray(), salt, iterationCount, keyStrength); SecretKey tmp = factory.generateSecret(spec); key = new SecretKeySpec(tmp.getEncoded(), "AES"); dcipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); AlgorithmParameters params = dcipher.getParameters(); iv = "0000000000000000".getBytes(); System.out.println("IV " + new sun.misc.BASE64Encoder().encodeBuffer(iv)); dcipher.init(Cipher.DECRYPT_MODE, key, new IvParameterSpec(iv)); byte[] decryptedData = new sun.misc.BASE64Decoder().decodeBuffer(base64EncryptedData); byte[] utf8 = dcipher.doFinal(decryptedData); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload