{"id":213,"date":"2026-09-03T01:53:26","date_gmt":"2026-09-03T01:53:26","guid":{"rendered":"https:\/\/neodata.com.uy\/labs\/?p=213"},"modified":"2026-09-06T22:19:01","modified_gmt":"2026-09-06T22:19:01","slug":"a-card-migration-is-a-state-machine","status":"publish","type":"post","link":"https:\/\/neodata.com.uy\/labs\/a-card-migration-is-a-state-machine\/","title":{"rendered":"A card migration is a state machine."},"content":{"rendered":"<p class=\"nlabs-kicker\">CRYPTOGRAPHIC MIGRATION<\/p>\n<h2 id=\"moving-a-live-fare-system-from-mifare-classic-to-mifare-plus-while-the-installed-base-continues-to-operate\">Moving a live fare system from MIFARE Classic to MIFARE Plus while the installed base continues to operate.<\/h2>\n<p>Cryptographic migration is often described by its endpoints. The old credential uses one mechanism; the new credential uses another. Replace the cards, update the readers and the system becomes stronger.<\/p>\n<p>A live transport system cannot usually move in one step. Cards may remain in circulation for years. Validators are updated by depot, vehicle or operator. Personalisation equipment and back-office services follow different release cycles. Lost and replacement media introduce further paths through the transition.<\/p>\n<p>Migration from MIFARE Classic to MIFARE Plus makes that reality explicit. MIFARE Plus was designed with compatibility and staged security levels that can support transition toward AES-based authentication and secure messaging. Those facilities are valuable, but they do not define the operator\u2019s migration.<\/p>\n<p>The migration is the set of states in which cards, readers, SAMs, keys and back-office rules may coexist\u2014and the controls that permit movement from one state to the next.<\/p>\n<h2 id=\"compatibility-is-a-starting-condition\">Compatibility is a starting condition<\/h2>\n<p>MIFARE Plus can participate in infrastructures originally built around MIFARE Classic. In compatibility-oriented modes, a new card can be introduced before every reader is ready for the stronger security mode. Later, the card can be moved toward AES-based operation when the surrounding infrastructure has been upgraded.<\/p>\n<p>This solves an important deployment problem: distribution and security activation do not need to occur on the same day.<\/p>\n<p>It also creates a period in which the system supports more than one security condition. If that period is not governed, compatibility can become permanent downgrade. The ability to operate like the old card should therefore be treated as a transitional state with entrance criteria, monitoring and an exit plan.<\/p>\n<p>The architecture needs to identify which operations are permitted in each state. Reading a non-sensitive identifier, updating a purse or modifying security configuration do not carry the same consequence. NXP\u2019s later MIFARE Plus EV2 features include sector-level migration and separation of access rights between legacy-compatible and stronger modes, illustrating how detailed that policy can become.<\/p>\n<h2 id=\"model-every-population\">Model every population<\/h2>\n<p>The word \u201cfleet\u201d hides several distinct populations:<\/p>\n<ul>\n<li>legacy MIFARE Classic cards;<\/li>\n<li>MIFARE Plus cards operating in a compatibility state;<\/li>\n<li>cards already activated for AES-based operation;<\/li>\n<li>readers capable only of the legacy flow;<\/li>\n<li>readers with updated firmware but old key material;<\/li>\n<li>readers and SAMs fully provisioned for both transition and target states;<\/li>\n<li>personalisation stations that create new cards or replace damaged ones.<\/li>\n<\/ul>\n<p>Each combination implies a transaction path. Some combinations must work temporarily; others must fail deliberately. A migration plan that lists components but not allowed combinations leaves critical behaviour to accident.<\/p>\n<p>A state matrix is more useful than a rollout slogan. For each card state and terminal generation, it records whether the operation is accepted, which authentication is used, which data may be changed and what evidence is logged.<\/p>\n<h2 id=\"keys-migrate-differently-from-cards\">Keys migrate differently from cards<\/h2>\n<p>A new algorithm requires new key material, but the key transition has its own lifecycle.<\/p>\n<p>Master keys need generation under an appropriate ceremony, separation by environment and purpose, controlled distribution to SAMs or personalisation systems, and versioning that lets the terminal choose the intended key without trial-and-error downgrade. Diversified card keys require stable, documented inputs and an agreed derivation method.<\/p>\n<p>During coexistence, a secure module may hold both legacy and target keys. That makes access control inside the module especially important. Firmware that can freely invoke every key has not gained much separation merely because the bytes are stored in secure hardware.<\/p>\n<p>The transition also needs answers for:<\/p>\n<ul>\n<li>readers that miss a key update;<\/li>\n<li>cards personalised with an unexpected key version;<\/li>\n<li>rollback after a failed application release;<\/li>\n<li>retirement of legacy keys after the last legitimate use;<\/li>\n<li>test keys accidentally carried into production paths;<\/li>\n<li>audit evidence showing which security mode protected a transaction.<\/li>\n<\/ul>\n<p>Card issuance is visible. Key population is quieter and often more consequential.<\/p>\n<h2 id=\"activation-should-be-monotonic\">Activation should be monotonic<\/h2>\n<p>A move to a stronger card state should normally be one-way. If a credential can be returned to a weaker mode through an ordinary field command, an attacker may be able to create the downgrade that the migration was intended to eliminate.<\/p>\n<p>Irreversible transitions deserve conservative preconditions. Before activation, the system should know that the target application data is valid, the required keys exist, the relevant readers have passed interoperability tests and a failed or interrupted operation has a defined outcome.<\/p>\n<p>An anti-tear mechanism helps preserve card data across interrupted writes, but it does not decide the business state. The surrounding software still needs to recognise whether an activation completed, whether a retry is safe and whether the card should be quarantined for controlled recovery.<\/p>\n<p>Monotonic does not mean rushed. It means that progress toward the target state is recorded and that rollback occurs through operational recovery\u2014not by silently restoring the weaker cryptographic condition.<\/p>\n<h2 id=\"data-compatibility-is-not-semantic-compatibility\">Data compatibility is not semantic compatibility<\/h2>\n<p>MIFARE Plus provides memory and command compatibility intended to ease migration from MIFARE Classic. Existing sector layouts and value operations may therefore remain technically accessible.<\/p>\n<p>That does not guarantee that the old data model should remain unchanged. A historical layout may have duplicated values, implicit version rules, terminal-maintained counters or assumptions tied to the old authentication flow. Reproducing those assumptions under AES preserves operational debt inside a stronger channel.<\/p>\n<p>The migration is an opportunity to distinguish three layers:<\/p>\n<ol type=\"1\">\n<li>the physical card and command set;<\/li>\n<li>cryptographic authentication and messaging;<\/li>\n<li>the application\u2019s record structure and transaction semantics.<\/li>\n<\/ol>\n<p>They can be migrated together or in planned stages, but they should not be confused. Changing the card\u2019s security level does not by itself correct weak application logic, excessive key sharing or an ambiguous fare record.<\/p>\n<h2 id=\"reader-firmware-carries-the-transition\">Reader firmware carries the transition<\/h2>\n<p>The reader is where many migration decisions become executable. It identifies the card family and state, selects a supported transaction path, coordinates with a SAM where present and produces an outcome within the time available at a gate or vehicle.<\/p>\n<p>Firmware therefore needs deterministic discovery. Repeatedly attempting protocols until one succeeds can create latency, obscure faults and accidentally enable downgrade. Card identification, supported capabilities and expected state should lead to one allowed path.<\/p>\n<p>Telemetry is essential during rollout. The back office should be able to distinguish an old card from a new card in legacy mode, an authentication failure from a missing key and a reader software defect from damaged media. Aggregate counts show whether the population is moving toward the target or accumulating in an intermediate state.<\/p>\n<p>Logs must avoid exposing keys or complete sensitive transaction data. Useful migration evidence consists of versions, states, failure classes and identifiers scoped for diagnosis.<\/p>\n<h2 id=\"rollout-is-a-security-control\">Rollout is a security control<\/h2>\n<p>A safe sequence usually upgrades the ability to accept the future state before issuing credentials that require it. Readers and secure modules receive code and keys, are tested across the actual card population, and only then does activation expand.<\/p>\n<p>Pilot groups should be chosen to expose operational diversity rather than merely minimise size. Depot connectivity, validator models, transaction load and recovery access can matter more than the number of cards.<\/p>\n<p>Exit criteria are equally important. The migration is not complete when most transactions use the new path. It is complete when legacy acceptance can be removed without excluding legitimate users, legacy keys can be retired, and monitoring confirms that no supported process still creates weaker-state credentials.<\/p>\n<p>Leaving the legacy path enabled \u201cjust in case\u201d preserves the attack surface indefinitely.<\/p>\n<h2 id=\"what-the-migration-proves\">What the migration proves<\/h2>\n<p>A successful MIFARE Plus transition does more than introduce AES. It demonstrates control of a distributed cryptographic lifecycle.<\/p>\n<p>The system can identify credential state, provision the correct keys, prevent unintended downgrade, survive interrupted transitions and explain failures across a heterogeneous installed base. Those capabilities are transferable to future algorithm and credential migrations.<\/p>\n<p>The essential artifact is not the new card specification. It is the state model shared by issuance, readers, secure modules and the back office.<\/p>\n<p>Cryptographic endpoints matter. Operational security is determined by every state allowed between them.<\/p>\n<hr \/>\n<h2 id=\"context-and-scope\">Context and scope<\/h2>\n<p>This note draws on transport-card migration work involving MIFARE Classic and MIFARE Plus. It presents the engineering structure of a staged migration without disclosing the transport operator, production keys, card data layout, rollout sequence or reader implementation.<\/p>\n<h2 id=\"references\">References<\/h2>\n<ol type=\"1\">\n<li><a href=\"https:\/\/www.nxp.com\/products\/MFPEV2\">NXP \u2014 MIFARE Plus EV2<\/a><\/li>\n<li><a href=\"https:\/\/www.nxp.com\/products\/MIFARE_PLUS_SE_1K\">NXP \u2014 MIFARE Plus SE<\/a><\/li>\n<li><a href=\"https:\/\/www.nxp.com\/products\/MIFSAMAV3\">NXP \u2014 MIFARE SAM AV3<\/a><\/li>\n<li><a href=\"https:\/\/www.nxp.com\/docs\/en\/application-note\/AN10922.pdf\">NXP AN10922 \u2014 Symmetric key diversifications<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Moving a live fare system from MIFARE Classic to MIFARE Plus is not a card replacement exercise. It is a controlled transition across credentials, readers, keys and operational states.<\/p>\n","protected":false},"author":2,"featured_media":270,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"nlabs_article_type":[],"class_list":["post-213","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-in-practice"],"_links":{"self":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":2,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":224,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/posts\/213\/revisions\/224"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/media\/270"}],"wp:attachment":[{"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/tags?post=213"},{"taxonomy":"nlabs_article_type","embeddable":true,"href":"https:\/\/neodata.com.uy\/labs\/wp-json\/wp\/v2\/nlabs_article_type?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}