JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html
https://ftsafe.en.alibaba.com/index.html
Generate a key based on a byte array
Generate a key based on a byte array
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
Note: my javacard version is JC2.1.1
Re: Generate a key based on a byte array
View the below screenshot from java card API 3.0.4
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.
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.
Who is online
Users browsing this forum: No registered users and 52 guests