"13131313131313130000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
data with another tool with public key of my applet. My applet can decrypt this data perfectly.
But when I encrypt
"FAFAFAFAFAFAFAFA0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
data and send it to my applet to decrypt it, however my applet cannot decrypt it correctly, it returns a different data.
Where did I make a mistake? Please give me some clues.
Code about decryption:
Code: Select all
private void key_load (APDU apdu)
{
byte [] apduBuffer = apdu.getBuffer();
apdu.setIncomingAndReceive();
cipherRSA2.init(PrivateKey, Cipher.MODE_DECRYPT);
cipherRSA2.doFinal(apduBuffer, (short)ISO7816.OFFSET_CDATA, (short)64, apduBuffer, (short)ISO7816.OFFSET_CDATA);
apdu.setOutgoingAndSend((short)5, (short)70);
}