...
Suivant le chiffrement utilisé, la longueur des clefs diffère (on donne aussi ici au passage les différents appellations pour ces chiffrements) :
- DES : 8 octets (bytes), soit 16 caractères en hexadécimal ;
- TDES (3DES, 2K3DES) : 16 octets, soit 32 caractères en hexadécimal ;
- TKTDES (3K3DES) : 24 octets, soit 48 caractères en hexadécimal ;
- AES : 16 octets, soit32 caractères en hexadécimal.
...
- le premier caractère correspond à (on rajoute 2 si on veut l'ISO)
- 0 pour DES comme pour TDES (2 avec l'iso)
- 4 pour TKTDES (6 avec l'iso)
- 8 pour AES (A avec l'iso)
- et le deucième caractère au nombre de clefs
...
Exemple de configuration
...
On rappelle ici que c'est l'AES qui est recommandé
| Bloc de code | ||||
|---|---|---|---|---|
| ||||
<bean id="desfireTagExample" class="org.esupportail.nfctag.beans.DesfireTag" p:formatBeforeWrite="true" p:keyStart="0000000000000000" p:keyTypeStart="DES"> <property name="applications"> <util:list> <!-- nok=02 correspond 2 clefs (T)DES - longueur clef de 8 bytes correspond à du DES --> <bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="F12340" p:amks="0B" p:nok="02"> <property name="files"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireFile" p:fileNumber="00" p:communicationSettings="03" p:accessRights="1111" p:tagWriteApi-ref="identifiantControleAccessTagWriteEsupSgcidp2sTagWriteEsupSgc"/> </util:list> < </property> <property <property name="keys"> <util:list> <bean <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="1000000000000000"/> <bean <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="1000000000000000"/> </util:list> </property> </bean> </util:list> </property> </bean> <!-- nok=02 correspond 2 clefs (T)DES - longueur clef de 16 bytes correspond à du TDES --> <bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="F12341" p:amks="0B" p:nok="02"> <property name="files"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireFile" p:fileNumber="00" p:communicationSettings="03" p:accessRights="1111" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/> </util:list> </property> <property name="keys"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="10000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="10000000000000000000000000000000"/> </util:list> </property> </bean> <!-- nok=42 correspond 2 clefs TKTDES - longueur clef de 24 bytes --> <bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="F12342" p:amks="0B" p:nok="42"> <property name="files"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireFile" p:fileNumber="00" p:communicationSettings="03" p:accessRights="1111" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/> </util:list> </property> <property name="keys"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="100000000000000000000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="100000000000000000000000000000000000000000000000"/> </util:list> </property> </bean> <!-- nok=82 correspond 2 clefs AES - longueur clef de 16 bytes --> <bean class="org.esupportail.nfctag.beans.DesfireApplication" p:desfireAppId="F12343" p:amks="0B" p:nok="82"> <property name="files"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireFile" p:fileNumber="00" p:communicationSettings="03" p:accessRights="1111" p:tagWriteApi-ref="idp2sTagWriteEsupSgc"/> </util:list> </property> <property name="keys"> <util:list> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="00" p:keyVer="01" p:key="10000000000000000000000000000000"/> <bean class="org.esupportail.nfctag.beans.DesfireKey" p:keyNo="01" p:keyVer="01" p:key="10000000000000000000000000000000"/> </util:list> </property> </bean> </util:list> </property> </bean> |