Skip to main content
12 events
when toggle format what by license comment
Jun 2, 2018 at 21:48 history edited Ilmari Karonen CC BY-SA 4.0
copyedit, make clear that the question can stand on its own even without the code, add authenticated-encryption tag
Jun 1, 2018 at 2:43 comment added Future Security You can use the same key as long as you change the IV
May 31, 2018 at 19:29 comment added Robert @FutureSecurity Are you suggesting that I rely on the master key rather than the derived key for the AES encryption? Is the point there simply that using a derived key is unnecessary? The 32-bit is a typo and should read 32-bytes (256 bit) for the key size.
May 31, 2018 at 2:28 comment added Future Security If you look into your actual requirements then you'll find that the former employee didn't implement the best construction regardless of how the algorithms are implemented or what libraries are used.
May 31, 2018 at 2:26 comment added Future Security The crypto part of this code looks really hack-y. Normally you use one key to encrypt many messages and use a different IV for each message. It is unnecessary (but acceptable) to derive a new key for each one for typical algorithms. What's extra sketchy is the KDF use. 1st you shouldn't use a 32 bit key even if you stretch it. 2nd you shouldn't re-derive a key (new or not) from a password. If your time cost is T and you derive 2 keys, you use 2T time and each key has T brute-force resistance. Instead derive one key in 2T time and use the master key to derive new keys (without more stretching)
May 31, 2018 at 2:10 comment added Future Security Code review is considered off topic for this exchange even when the code involves cryptography. If you want to know if some construct is secure then you can ask a question about that. Then you should replace code with a precise statement of what algorithms are being used and the specifics of how they're used.
May 31, 2018 at 1:33 comment added Maarten Bodewes MarkDown has specific formatting to create (un-) numbered lists (also available as button). I've definitely seen worse code, great that you're moving away from mcrypt.
May 31, 2018 at 1:32 history edited Maarten Bodewes CC BY-SA 4.0
formatting
May 31, 2018 at 1:30 answer added Maarten Bodewes timeline score: 4
May 31, 2018 at 1:22 review Close votes
Jun 5, 2018 at 21:58
May 30, 2018 at 21:50 review First posts
May 31, 2018 at 20:04
May 30, 2018 at 21:48 history asked Robert CC BY-SA 4.0