The exclusive promotional activities on JCOP J3H145 card and Feitian R301 Smartcard Reader are in full swing. Please check this page for details.

Send GP commands with MAC via pyApduTool or pyResMan

JCIDE related questions and answers.

Moderators: product, kuafu

posey
Posts: 11
Joined: Mon Dec 07, 2015 1:44 am
Points :52
Contact:

Send GP commands with MAC via pyApduTool or pyResMan

Post by posey » Tue Nov 29, 2016 3:01 am

How can I send GP commands with MAC via pyApdutool or pyResMan? THX

User avatar
mabel
Posts: 237
Joined: Mon May 18, 2015 3:09 am
Points :1697
Contact:

Re: Send GP commands with MAC via pyApduTool or pyResMan

Post by mabel » Wed Nov 30, 2016 4:48 am

pyApdutool or pyResMan might not meet your requirement.
You can use GPShell.

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

choimillen
Posts: 30
Joined: Wed Aug 19, 2015 2:55 am
Points :207
Contact:

Re: Send GP commands with MAC via pyApduTool or pyResMan

Post by choimillen » Wed Nov 30, 2016 5:02 am

Just set SecurityLevel value to 1 or 3, then you can send GP command with MAC and encrypt command data as well.

posey
Posts: 11
Joined: Mon Dec 07, 2015 1:44 am
Points :52
Contact:

Re: Send GP commands with MAC via pyApduTool or pyResMan

Post by posey » Wed Nov 30, 2016 11:40 pm

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?

choimillen
Posts: 30
Joined: Wed Aug 19, 2015 2:55 am
Points :207
Contact:

Re: Send GP commands with MAC via pyApduTool or pyResMan

Post by choimillen » Thu Dec 01, 2016 2:03 am

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.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 2 guests

JavaCard OS : Disclaimer