how to convert byte array to key format??

Posted by sebby_zml on Stack Overflow See other posts from Stack Overflow or by sebby_zml
Published on 2010-05-06T03:33:35Z Indexed on 2010/05/06 3:38 UTC
Read the original article Hit count: 382

Filed under:
|
|
|

hi everyone,

i would like to know how to convert byte array into key.

i am doing an AES encryption/decryption. instead of generating a key, i would like to use my generated byte array.

byte[] clientCK = Milenage.f3(sharedSecret16, RANDbytes, opc);  

let say i have a byte array called clientCK, stated above. i want to use it in AES encryption as shown below.

Cipher c = Cipher.getInstance("AES");
c.init(Cipher.ENCRYPT_MODE, key);
byte[] encValue = c.doFinal(valueToEnc.getBytes());
String encryptedValue = new BASE64Encoder().encode(encValue);

therefore, i need to convert that byte array clientCK into key format. please help.

© Stack Overflow or respective owner

Related posts about aes-encrypt

Related posts about key