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
How to generate random data?
Moderator: UNKNwYSHSA
How to generate random data?
as the title, how to generate random data in my applet?
Re: How to generate random data?
You can reference this first,maybe it is useful.
viewtopic.php?f=31&t=1265&p=4068&hilit=random#p4068
viewtopic.php?f=31&t=1265&p=4068&hilit=random#p4068
Re: How to generate random data?
Code: Select all
RandomData rand = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
short lenBytes = (short) (KeyBuilder.LENGTH_DES3_3KEY/8);
byte[] buffer = JCSystem.makeTransientByteArray(lenBytes, JCSystem.CLEAR_ON_DESELECT);
DESKey key = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_3KEY, false);
rand.generateData(buffer, (short) 0, lenBytes);
key.setKey(buffer, (short) 0);
The above is a method to generate a random DES key, you can refer
Who is online
Users browsing this forum: Bing [Bot] and 7 guests