RSA library problem on ZC45D (Rev. B)?


[ Follow Ups ] [ BasicCard User Forum ]

Posted by emmanuelf (194.41.152.158) on August 25, 2008 at 08:02:19:

Hi to all!

I am currently trying to implement an over-simple RSA encryption command with the following hardware configuration:
BasicCard: ZC45D (Rev. B)
Reader: Omnikey Cardman 5121 trough PC/SC

Basically I based my trial on the RSA sample code provided with the ZC's documentation. The idea is just to hardcode the value of the public key in the eeprom in perform an encryption of the incoming data. Shortly explained here is an extract of what I wrote in "MyRSACard.bas":

rem Key declaration/initialisation (it is the public key used as example in the documentation…):

Eeprom e$ As String*4 = _ &H8F,&H48,&H84,&H81 Eeprom n$ As String*128 = _ &HA3,&HB5,&H65,&H12,&H22,&H11,&H2A,&H17,&H07,&H58,&HAD,&H21,&H08,&HF4,&H1C,&H0D,_ &HFF,&H9B,&H3B,&H4C,&H62,&HD1,&H78,&H89,&H7C,&H0A,&HE9,&HC4,&HDA,&HEB,&H5B,&H7F,_ &H5C,&H05,&HB4,&H4C,&HC8,&H22,&HC0,&HBE,&HFF,&HEE,&H26,&H8C,&HB2,&H68,&HCF,&H25,_ &H46,&H99,&H5B,&HB6,&HA6,&H26,&H4C,&HC9,&H21,&H80,&H33,&HDF,&H57,&H3E,&H56,&H44,_ &H75,&H08,&H25,&HE0,&H0E,&H22,&H61,&HC8,&H19,&H32,&H67,&H2D,&H89,&H77,&H1D,&HBB,_ &H63,&H54,&H5C,&H61,&H98,&H2B,&HA7,&H70,&HE5,&HD0,&HA8,&H05,&H44,&HF7,&HE6,&H6F,_ &HBF,&HBC,&H48,&HDB,&HF8,&HDE,&H0A,&HE3,&H35,&H03,&HA4,&H5C,&H8E,&HB0,&H86,&H7B,_ &H08,&H08,&HAE,&H86,&H47,&HC1,&H10,&H33,&H36,&HAA,&H55,&H61,&HEA,&HE9,&HEF,&H23
rem Crypto command:
Command &H00 &H88 CryptComm(Data$) Call RsaEncrypt(Data$,n$,e$) End Command
But… the card cannot execute this command and I get an error from the reader. I do not think it is a timing problem because immediately after the sending of that command the reader sends its error message.

I tried a lot of various combinations (shorter keys, different syntaxes and so on) but without any success.

Beside this I tried functionalities from other libraries like ShaHash() hashing function without problem.

If anyone of the community could answer to one or more of the following question, it could be of a great help for me:
- Does the ZC45D (Rev. B) 100% support the RSA lib? (ZC45D card actual revision is F…)
- By the way, is the ZC45D Rev. F still available at ZeitControl?
- Is there a known incompatibility with the Omnikey readers?
- Some basic error in my implementation?

Thank you in advance.

Regards,

Manu



Follow Ups:


[ Follow Ups ] [ BasicCard User Forum ]