public static byte[] generateSecretKey(Configuration conf, String cypherAlg, byte[]... args) {
    StringBuilder sb = new StringBuilder();
    for (byte[] b : args) {
      sb.append(Arrays.toString(b));
    }
    int keyLength = Encryption.getCipher(conf, cypherAlg).getKeyLength();
    return generateSecretKey("PBKDF2WithHmacSHA384", keyLength, sb.toString().toCharArray());
  }
Return a key derived from the concatenation of the supplied arguments using
PBKDF2WithHmacSHA384 key derivation algorithm at 10,000 iterations. The length of the returned
key is determined based on the need of the cypher algorithm. E.g. for the default "AES" we will
need a 128 bit long key, while if the user is using a custom cipher, we might generate keys
with other length. This key generation method is used currently e.g. in the HBase Shell
(admin.rb) to generate a column family data encryption key, if the user provided an
ENCRYPTION_KEY parameter.
hbase-common/src/main/java/org/apache/hadoop/hbase/io/crypto/Encryption.java