It looks like the secure chip in the Nokia NFC phones does not support Elliptic Curve Cryptography - RSA works fine though. I've tried to create ECC keypairs using NIST curve specifications SECP160K1 and SECT163K1 but the response is 0x6F03 (no such algorithm). However the latter curve does work (signature generation and verification OK) on my single and dual interface smart cards (JCOP20/JCOP30).
In my previous post I saw that the COS for the Nokia 6131 NFC is G&D SmartCafe Expert 3.1 In G&D's sparse public documentation and SmartCafe Expert 3.1 flyer only RSA is mentioned so I conclude ECC is definitely not supported. As an interesting side note, the flyer says the COS is JavaCard 2.2.1 compliant - which confirms a conclusion in an earlier post.
Since there are so few other mobiles with NFC I guess we'll have to wait for microSD cards with embedded NFC and secure elements which support ECC.
Showing posts with label 6131. Show all posts
Showing posts with label 6131. Show all posts
Tuesday, 31 August 2010
Monday, 24 August 2009
Card Recognition Data
To get the GPShell open_sc command to work with an applet instance (not the Security Domain), we must ensure that the correct Secure Channel Protocol implementation number is specified.
This number can be retrieved from the Card Recognition Data TLV fields via the OpenPlatform get-data command on tag 0x66 (send APDU 80CA0066) after selecting the Card Manager. For example, with the Nokia 6131 NFC phone, the command returns:
The field at tag 64 (offset 50 in the unformatted string) aka "application tag - GP OID 04" has scp=0x2 (SCP02), i=0x55=85 (scpimpl). Note that this is different from the default i=0x15!
The field at tag 60 aka "application tag - GP OID 02" specifies the GlobalPlatform version, namely GP2v2.1.1 (compare with value in given by ATR and OpenPlatform get-cplc command). This gives a clue as to the Java Card version that can be expected (2.2.1).
The GPShell command to open a secure channel (MAC and ENC) to an applet in the Secure Domain would then be (after selecting the applet):
Note: according to the GP spec. H.3, the GP select command on the Security Domain may return TLV values which - if present - override the Card Recognition Data described previously. What exactly this implies I still have to figure out ...
****
Update: I discovered that the COS on the IC in the Nokia is G&D SmartCafe Expert 3.1 which is indeed Java Card 2.2.1 compliant. See this post.
This number can be retrieved from the Card Recognition Data TLV fields via the OpenPlatform get-data command on tag 0x66 (send APDU 80CA0066) after selecting the Card Manager. For example, with the Nokia 6131 NFC phone, the command returns:
66 4CThe response is formatted into TLV fields according to GP 2.1.1 Section F.2 or GP 2.2 Section H.2, "Structure of Card Recognition Data".
--73 4A
----06 07 2A864886FC6B 01
--60 0C
----06 0A 2A864886FC6B 02 02 01 01
--63 09
----06 07 2A864886FC6B 03
--64 0B
----06 09 2A864886FC6B 04 02 55
--65 0B
----06 09 2B8510864864020103
--66 0C
--06 0A 2B060104012A026E0102
9000
The field at tag 64 (offset 50 in the unformatted string) aka "application tag - GP OID 04" has scp=0x2 (SCP02), i=0x55=85 (scpimpl). Note that this is different from the default i=0x15!
The field at tag 60 aka "application tag - GP OID 02" specifies the GlobalPlatform version, namely GP2v2.1.1 (compare with value in given by ATR and OpenPlatform get-cplc command). This gives a clue as to the Java Card version that can be expected (2.2.1).
The GPShell command to open a secure channel (MAC and ENC) to an applet in the Secure Domain would then be (after selecting the applet):
open_sc -security 3 -keyind FF -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -scpimpl 85 -scp 2where "-scpimpl 85" specifies the decimal value of the SCP number.
Note: according to the GP spec. H.3, the GP select command on the Security Domain may return TLV values which - if present - override the Card Recognition Data described previously. What exactly this implies I still have to figure out ...
****
Update: I discovered that the COS on the IC in the Nokia is G&D SmartCafe Expert 3.1 which is indeed Java Card 2.2.1 compliant. See this post.
Thursday, 25 June 2009
Nokia NFC SDK
Nokia rolled out their 6131 NFC model around January 2007, aimed mainly at developers. To upload your own MIDlets to the phone you have to ask your dealer to factory unlock the phone, or do it yourself via an Unlock MIDlet (Nokia wiki listed below has a link) which will prevent it from working with trusted MIDlets and applets afterwards. Nokia makes up for this royal pain by offering a decent NFC and MIDlet SDK, and the developer community for their products is quite big and provides good support.
Good places to start reading:
Note: Unlocked Nokia 6131 NFC phones all use the same key-set, namely
Good places to start reading:
- Official Nokia NFC SDK page
- Forum Nokia Documentation and Tools pages
- Forum Nokia wiki FAQ for 6131 NFC
- Nokia Secure Chip FAQ
- Nokia MIDlet development tutorial
Note: Unlocked Nokia 6131 NFC phones all use the same key-set, namely
42/1/DES-ECB/404142434445464748494a4b4c4d4e4fand security protocol is the GP default: SCP02 option 15 (CMAC+ENC, refer to Nokia 6131 NFC Technical Product Description v1.0 section 7.2, p 26). For JCOP Tools this translates to using ext-auth enc, while in GPShell you would use mode_211 and open_sc -security 3 [...] A detailed discussion with examples can be found on the Nokia Forum. For detailed definitions of SCP02 and its options, refer to Global Platform Card Specification 2.1.1 Appendix E.1.1, p213.
42/2/DES-ECB/404142434445464748494a4b4c4d4e4f
42/3/DES-ECB/404142434445464748494a4b4c4d4e4f
Labels:
6131,
GPShell,
JCOP Tools,
MIDlet,
NFC,
Nokia,
SCP02,
SDK,
secure chip,
secure element
Subscribe to:
Posts (Atom)