NAME
DesfireAPI :: Authentification functions
COPYRIGHT
(c) 2009 SpringCard - www.springcard.com
DESCRIPTION
Implementation of the various DESFIRE authentification functions.
NAME
Authenticate
DESCRIPTION
Perform authentication using the specified DES or 3DES key on the currently selected DESFIRE application. This is the legacy function, available even on DESFIRE EV0. The generated session key is afterwards used for non-ISO ciphering or macing.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Authenticate(BYTE bKeyNumber, const BYTE pbAccessKey[16]); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Authenticate(SPROX_INSTANCE rInst, BYTE bKeyNumber, const BYTE pbAccessKey[16]); [[pcsc_desfire.dll]] LONG SCardDesfire_Authenticate(SCARDHANDLE hCard, BYTE bKeyNumber, const BYTE pbAccessKey[16]);
INPUTS
BYTE bKeyNumber : number of the key (KeyNo) const BYTE pbAccessKey[16] : 16-byte Access Key (DES/3DES2K keys)
RETURNS
DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.
NOTES
Both DES and 3DES keys are stored in strings consisting of 16 bytes : * If the 2nd half of the key string is equal to the 1st half, the key is handled as a single DES key by the DESFIRE card. * If the 2nd half of the key string is NOT equal to the 1st half, the key is handled as a 3DES key.
SEE ALSO
Authenticate24 AuthenticateAes ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion
NAME
Authenticate24
DESCRIPTION
Perform authentication using the specified DES or 3DES key on the currently selected DESFIRE application. This function is not available on DESFIRE EV0 cards. The generated session key is afterwards used for ISO ciphering or c-macing.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Authenticate24(BYTE bKeyNumber, const BYTE pbAccessKey[24]); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Authenticate24(SPROX_INSTANCE rInst, BYTE bKeyNumber, const BYTE pbAccessKey[24]); [[pcsc_desfire.dll]] LONG SCardDesfire_Authenticate24(SCARDHANDLE hCard, BYTE bKeyNumber, const BYTE pbAccessKey[24]);
INPUTS
BYTE bKeyNumber : number of the key (KeyNo) const BYTE pbAccessKey[24] : 24-byte Access Key (DES/3DES2K/3DES3K keys)
RETURNS
DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.
NOTES
Both DES and 3DES keys are stored in strings consisting of 24 bytes : - If the 2nd third of the key string is equal to the 1st third, the 64-bit key is handled as a single DES key by the DESFIRE card (well, actually there are only 56 significant bits). - If the 2nd third of the key string is NOT equal to the 1st third AND the 3rd third is equal to the 1st third, the key is a 128 bit 3DES key (well, actually there are only 112 significant bits). - Overwise, the key is a 192 bit 3DES key "3DES3K mode" (well, actually (well, actually there are only 168 significant bits).
SEE ALSO
Authenticate AuthenticateAes ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion
NAME
AuthenticateAes
DESCRIPTION
Perform authentication using the specified AES key on the currently selected DESFIRE application. This function is not available on DESFIRE EV0 cards. The generated session key is afterwards used for ISO ciphering or c-macing.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_AuthenticateAes(BYTE bKeyNumber, const BYTE pbAccessKey[16]); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_AuthenticateAes(SPROX_INSTANCE rInst, BYTE bKeyNumber, const BYTE pbAccessKey[16]); [[pcsc_desfire.dll]] LONG SCardDesfire_AuthenticateAes(SCARDHANDLE hCard, BYTE bKeyNumber, const BYTE pbAccessKey[16]);
INPUTS
BYTE bKeyNumber : number of the key (KeyNo) const BYTE pbAccessKey[16] : 16-byte Access Key (AES)
RETURNS
DF_OPERATION_OK : authentication succeed Other code if internal or communication error has occured.
NOTES
AES keys are always 128-bit long.
SEE ALSO
Authenticate Authenticate24 ChangeKeySettings GetKeySettings ChangeKey GetKeyVersion