Contactless Mifare API

The Aloaha Smart Card API now also supports contactless Mifare Cards. Suggested cards are the standard Mifare 1k or 4k cards.
A very good contactless Card Reader is the Omikey 5x21.

It is suggested to leave the default Passwords of the cards on FFFFFFFFFFFF or A1A2A3A4A5A6. If other password should be used please open the cardini.ini in Wrocklage and add to the Mifare Section Mifare=PIN.

For example:

[DA BC 12 93]
ATR=3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00 00 00 00 69
MifareName=Mifare Standard 4K
Mifare=AABBCCDDEEFF


The memory management on the card will automatically being done by Aloaha. Additional to the standard Mifare encryption all data will be 3DES encrypted.


Aloaha Mifare API explained

The Mifare API is part of the Aloaha Card API in Object AloahaCSP.Aloaha_csp.
In VBS you would create the object with set CSP=createobject("aloahacsp.aloaha_csp").

Now a connection with the cardreader has to be etablished. Aloaha can support up to 10 Readers with ID 0 to 9.
To etablish the connection just call: csp.set_reader(CLng(1)) for the 2nd connected reader. The return value is bool.

For example: 
dim csp
set csp = createobject("aloahacsp.aloaha_csp")

if csp.set_reader(CLng(0)) = True then
          msgbox "Connected to first reader"
End If 

set csp = nothing


After a connection to the reader has been etablished the following function calls are possible.


MifareClear

This command wipes eveything from the Mifare Card which has ever been written to it with Aloaha. It is called automatically by MifareWriteCard before contents are being written!


MifareWriteCard

This command is used to write the Data to the card. It allocates automatically the required space accross the card and returns bool.

The command syntax is:

retbool=csp.MifareWriteCard(KeyNumber As Long, BlockContentHEX As String, KeyHex As String)


MifareReadCard

This command reads the Data from the Mifare Card. Please note that it returns ONLY data which was written by Aloaha. It does also NOT return Data which was marked as secret. The Data is returned as HEX String!

Syntax: 

RetStringHEX=csp.MifareReadCard(KeyNumber As Long, KeyHex As String, KeyType As Long)



Variables:


KeyNumber defines the Card Key to be used. It can be any decimal value between 0 and 31.

BlockContentHEX contains the Content to be written to the card. Please note that is has to be a HEX String!

KeyHex is the PIN to be used. If left empty Aloaha will use the default Keys FFFFFFFFFFFF/A1B2B3B4B5B6 or the value defined in the cardini.ini

KeyType should always be decimal 96.




Please ask...

Although we really tried hard, there are always questions left open. But perhaps somebody else had already put the same question?
Please check!
  • I am investigating the possibility to use our Mifare Classic 1K cards for two factor authentication on Windows 7. I have a Cherry G81-8070LUC keyboard with contactless card reader. We already store data on sector 1 of the Mifare card. Would it be possible to use Aloaha and to link the card UID to the username?
    Aloaha developed an innovative filesystem and PKI emulation for Mifare Classic Cards. With that emulation it is possible to use Mifare Classic Cards like normal PKI cards in Windows XP, 2000/3/8, Vista and Windows 7. Please contact us at info@aloaha.com for further details.
    Answered 08.06.2010
  • hi ,
    i am working on mifare 1 k card with omnikey card man 5x21.
    i want to chage the authentication pin. can u tell me how to change the defult value "FFFFFFFFFFFF" to other value.
    thanks

  • Hi,

    We are very new with smartcard login,
    We want to configure Mifare DesFire 4k smartcards to login on a Vista workstation with a Windows server 2008 as domain controller.

    Can you give me some steps how to configure the smartcard login?
    The Mifare cards are not regonized by default in Windows, what must we do to make this work?

    please help

    greetings Ashwin

If not, please do not hesitate to send us your question.
We would be glad to answer it.
PDF SDKPDF Form Saver SDKSmart Card APIAloaha CSP APIAPIs and samplesPin Pad Notifier Pluginp7m / p7s CreationCDO to S/MimeCreate S/Mime PKCS7Create / Validate PKCS #7Create CMS (PKCS #7)Show Card CertificatesADPU TesterSmart Card TesterTimestamp PKCS7 SignatureDES EncryptionHash DataXML HelperEnumerate Card ReaderMifareAloaha Mifare Code SampleContactless PIN TokenMifare PKI CardAloaha Web ServicesAloaha Print MonitorAloaha Remote ConfigurationWebDAVLDAP ClientProgramming Office MacrosIIS Event Sinks