Page 1 of 1

Send GP commands with MAC via pyApduTool or pyResMan

Posted: Tue Nov 29, 2016 3:01 am
by posey
How can I send GP commands with MAC via pyApdutool or pyResMan? THX

Re: Send GP commands with MAC via pyApduTool or pyResMan

Posted: Wed Nov 30, 2016 4:48 am
by mabel
pyApdutool or pyResMan might not meet your requirement.
You can use GPShell.

FYI:
https://sourceforge.net/p/globalplatform/wiki/GPShell/

Re: Send GP commands with MAC via pyApduTool or pyResMan

Posted: Wed Nov 30, 2016 5:02 am
by choimillen
Just set SecurityLevel value to 1 or 3, then you can send GP command with MAC and encrypt command data as well.

Re: Send GP commands with MAC via pyApduTool or pyResMan

Posted: Wed Nov 30, 2016 11:40 pm
by posey
choimillen wrote:Just set SecurityLevel value to 1 or 3, then you can send GP command with MAC and encrypt command data as well.


Thanks for your answer. But what's SecurityLevel value used to do?

Re: Send GP commands with MAC via pyApduTool or pyResMan

Posted: Thu Dec 01, 2016 2:03 am
by choimillen
The below is the related description quoted from Chapter SecurityLevel in GlobalPlatform spec.
SCP02 -> Secure Communication -> Security Level

C_MAC after a successful processing of an EXTERNAL AUTHENTICATE command with P1 indicating C-MAC (P1='x1' or 'x3')
C_DECRYPTION after a successful processing of an EXTERNAL AUTHENTICATE command with P1 indicating Command Encryption (P1= 'x3')


0 indicates there is no message security processing
1 indicates adding a MAC authentication to the message.
3 indicates adding a MAC authentication to the message and encrypt the message.