[ 
https://issues.apache.org/jira/browse/HADOOP-10719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14051747#comment-14051747
 ] 

Mike Yoder commented on HADOOP-10719:
-------------------------------------

Crypto-nerd comments - in generateEncryptedKey()...
- The line "SecureRandom.getInstance("SHA1PRNG").nextBytes(newKey);" - two 
things: SHA1 is obsolete, can you choose something stronger?  I don't know what 
the set of valid options are, but if there is one that resembles "NIST SP 
800-90" then pick that one.  Also you're doing the getInstance call every time 
through this function, better to call it once for the class and then just call 
nextBytes in this function?  We probably also will want to build in new 
re-seeding logic around this random stream.  Key generation is highly 
scrutinized, trust me!
- The line "Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding");" - can you 
please use CBC mode instead of CTR mode?  If we use CTR mode we're subjecting 
the encrypted DEK to all the attacks we're trying to avoid for the data itself. 
 CBC mode has none of the nasty ciphertext attack problems that CTR mode has.

> Add generateEncryptedKey and decryptEncryptedKey methods to KeyProvider
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-10719
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10719
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>    Affects Versions: 3.0.0
>            Reporter: Alejandro Abdelnur
>            Assignee: Arun Suresh
>         Attachments: HADOOP-10719.1.patch, HADOOP-10719.2.patch, 
> HADOOP-10719.patch, HADOOP-10719.patch, HADOOP-10719.patch, 
> HADOOP-10719.patch, HADOOP-10719.patch
>
>
> This is a follow up on 
> [HDFS-6134|https://issues.apache.org/jira/browse/HDFS-6134?focusedCommentId=14036044&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14036044]
> KeyProvider API should  have 2 new methods:
> * KeyVersion generateEncryptedKey(String keyVersionName, byte[] iv)
> * KeyVersion decryptEncryptedKey(String keyVersionName, byte[] iv, KeyVersion 
> encryptedKey)
> The implementation would do a known transformation on the IV (i.e.: xor with 
> 0xff the original IV).



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to