Note that there are some explanatory texts on larger screens.

plurals
  1. POEncryption with AES-256 and the Initialization Vector
    primarykey
    data
    text
    <p>I have a question relating to the use of an Initialization Vector in AES encryption. I am referencing the following articles / posts to build encryption into my program: </p> <p>[1] <a href="https://stackoverflow.com/questions/992019/java-256bit-aes-encryption">Java 256-bit AES Password-Based Encryption</a><br> [2] <a href="http://gmailassistant.sourceforge.net/src/org/freeshell/zs/common/Encryptor.java.html" rel="nofollow noreferrer">http://gmailassistant.sourceforge.net/src/org/freeshell/zs/common/Encryptor.java.html</a></p> <p>I was originally following erickson's solution from the first link but, from what I can tell, PBKDF2WithHmacSHA1 is not supported on my implementation. So, I turned to the second link to get an idea for my own iterative SHA-256 hash creation. </p> <p>My question comes in how the IV is created. One implementation ([1]) uses methods from the Cypher class to derive the IV where are the other ([2]) uses the second 16 bytes of the hash as the IV. Quite simply, why the difference and which is better from a security standpoint? I am kinda confused to the derivation and use of IVs as well (I understand what they are used for, just not the subtler differences), so any clarification is also very welcome.</p> <p>I noticed that the second link uses AES-128 rather than AES-256 which would suggest to me that I would have to go up to SHA-512 is I wanted to use this method. This seems like it would be an unfortunate requirement as the user's password would have to be 16 characters longer to ensure a remotely secure hash and this app is destined for a cell phone.</p> <p>Source is available on request, though it is still incomplete.</p> <p>Thank you in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    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