Package io.anyline.nfc.Tools
Class Crypto
-
- All Implemented Interfaces:
public class Crypto
-
-
Constructor Summary
Constructors Constructor Description Crypto()
-
Method Summary
Modifier and Type Method Description Array<byte>
generateRandomBytes(int size)
Array<byte>
calculateSeed(String passportNbr, String dateOfBirth, String dateOfExpiration)
returns Kseed 16 bytes Array<byte>
calculateMacKey(Array<byte> seed)
return 16 bytes Mac key Array<byte>
sha1(Array<byte> input)
Array<byte>
padData(Array<byte> data, int padSize)
Array<byte>
calculate3DESEncryptionKey(Array<byte> seed)
Array<byte>
calculateAESEncryptionKey(Array<byte> seed)
Array<byte>
encryptUsingDES(Array<byte> key, Array<byte> payload)
Array<byte>
decryptUsingDES(Array<byte> key, Array<byte> payload)
Array<byte>
calculate3DESMac(Array<byte> macKey, Array<byte> message, boolean addPad)
MAC algorithm 3 of ISO/IEC 9797-1 Array<byte>
calculateAESMac(Array<byte> macKey, Array<byte> message, boolean addPad)
Array<byte>
encrypt3DES(Array<byte> key, Array<byte> payload)
Array<byte>
encryptAES(Array<byte> key, Array<byte> payload)
Array<byte>
decrypt3DES(Array<byte> key, Array<byte> payload)
3DES Array<byte>
decryptAES(Array<byte> key, Array<byte> payload)
-
-
Method Detail
-
generateRandomBytes
Array<byte> generateRandomBytes(int size)
-
calculateSeed
Array<byte> calculateSeed(String passportNbr, String dateOfBirth, String dateOfExpiration)
returns Kseed 16 bytes
-
calculateMacKey
Array<byte> calculateMacKey(Array<byte> seed)
return 16 bytes Mac key
-
calculate3DESEncryptionKey
Array<byte> calculate3DESEncryptionKey(Array<byte> seed)
-
calculateAESEncryptionKey
Array<byte> calculateAESEncryptionKey(Array<byte> seed)
-
encryptUsingDES
Array<byte> encryptUsingDES(Array<byte> key, Array<byte> payload)
-
decryptUsingDES
Array<byte> decryptUsingDES(Array<byte> key, Array<byte> payload)
-
calculate3DESMac
Array<byte> calculate3DESMac(Array<byte> macKey, Array<byte> message, boolean addPad)
MAC algorithm 3 of ISO/IEC 9797-1
-
calculateAESMac
Array<byte> calculateAESMac(Array<byte> macKey, Array<byte> message, boolean addPad)
-
encrypt3DES
Array<byte> encrypt3DES(Array<byte> key, Array<byte> payload)
-
encryptAES
Array<byte> encryptAES(Array<byte> key, Array<byte> payload)
-
decrypt3DES
Array<byte> decrypt3DES(Array<byte> key, Array<byte> payload)
3DES
-
decryptAES
Array<byte> decryptAES(Array<byte> key, Array<byte> payload)
-
-
-
-