Page 1 of 1

My cards can work with wrong GP keys, why?

Posted: Mon Dec 07, 2015 5:33 am
by Tazmania09
As we all know, GP keys offcard should be the same as the keys on card. Otherwise, you can't do any operation on your card.

But I came across a strange thing. I used pyApdutool to operate my java card.

And, my card's GP keys are as follows:
S-ENC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
C-MAC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
DEK: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F

In pyApdutool, I set the GP key as:
S-ENC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4E
C-MAC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
DEK: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F

Though S-ENC key offcard is different with the key oncard, I can also upload and install applet successfully. It works fine with two different keys.
How strange it is! Could anyone tell me why this happened? Is this a bug in my card?


Re: My cards can work with wrong GP keys, why?

Posted: Fri Dec 11, 2015 3:07 am
by mabel
You only changed the parity bit which is not used by the card. So no matter how you change this parity bit, it doesn't influence the outcome of cipher computation.