JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Generate a key based on a byte array

JavaCard Applet Development Related Questions and Answers.
Usiger
Posts: 15
Joined: Tue Mar 01, 2016 3:56 am
Points :161
Contact:

Generate a key based on a byte array

Post by Usiger » Sun Jul 17, 2016 11:19 pm

There is a PIN in my applet, which is needed to encrypt by 3DES. I have a byte array "pw_ar" and I want to generate a key for 3DES algorithm based on this array. How can I do this? Thanks! Any reply is appreciated!

Note: my javacard version is JC2.1.1

wousim
Posts: 14
Joined: Tue Feb 16, 2016 10:12 pm
Points :109
Contact:

Re: Generate a key based on a byte array

Post by wousim » Mon Jul 18, 2016 3:46 am

View the below screenshot from java card API 3.0.4



DESKey contains an 8/16/24-byte key for single/2 key triple DES/3 key triple DES operations.


For example:
If you want to use 3 key 3DES: You will need a 24 byte array containing some data related to your password. You should use a message digest function (sha, md5 etc) and hash your password. This will generate you a digest. From this digest you take the first 24 bytes, which you can use as your 3DES key.
You do not have the required permissions to view the files attached to this post. Please login first.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 52 guests

JavaCard OS : Disclaimer