This answer is also a bit long, because a misunderstanding needs to be explained. The text above is about authentication using an asymmetric key pair. Since no one can prove anything except that the private adversary is a public key, additional credentials are needed. The issuer of the certificate usually claims to confirm your identity, and this is documented by the signatures of the certificate (the signature is useful if the issuer's public key is known from the Internet or because it is already stored on the card). Typically, a smart card provides the “Perform Security Operation” command in the “Verify Certificate” mode for this purpose: it verifies the issuer's signature, unpacks the public key contained in the certificate or is supplied with it, and saves it for private use will be executed soon.
Your code snippet is about authentication using a symmetric key, also called a private key. It is assumed that this secret is known only to authorized people. 0x81, which you consider LC, is actually P2, which means "take local key number 1" to verify the MAC calculation with this secret key. In fact, if we take an 8-byte random number as input for calculating (both retail and any other) MAC, then (for example, using standard add-on schemes) will lead to a 16-byte result. By the way, the DES key in the example is terrible. The least significant bit of each byte is the parity bit, so the key consists of only zero bytes.
Both schemes have nothing to do with the goal of somehow performing authentication.
For more information, see ISO 7816-8 (for performing a security operation), ISO 7816-4 (for external authentication, receiving a call, and most other smart card commands). They are hard to get without spending money - older versions can be found at www - and are pretty dry to read and understand hard. More explanation can be found in Rankl / Effing "Handbuch der Chipkarten", but it is reported that the English translation of "Smart Card Handbook" is sometimes used. For certificate materials, I would recommend Schneier, Applied Cryptography, which also has hundreds of additional links.
guidot
source share