Four digits, and why they need all this
A payment PIN is four digits, sometimes six. A thousand guesses would exhaust a four-digit PIN by brute force, and ten thousand certainly would. Everything in this course exists because of that arithmetic.
Two defences carry the whole weight, and neither is the PIN's own strength.
The PIN is never exposed in clear outside protected hardware. From the moment it is keyed, it exists only inside a tamper-resistant device or as ciphertext. It is not logged, not stored by the merchant, not visible to the acquirer's operators, and not readable in a database. If it were ever available in bulk, its length would make it worthless.
Attempts are counted and bounded. A chip blocks itself after a few consecutive failures; an issuer host does the same for online verification. Three guesses against ten thousand possibilities is a usable control. Unlimited guesses would not be.
That is why the subject is really about keys and hardware rather than about PINs. PCI's own description of the standard says as much: the PIN Security Standard "is intended for the secure management, processing, and transmission of personal identification numbers (PINs) and associated cryptographic keys."
Three consequences shape the rest of the course.
Every hop needs its own protection. A PIN entered at a shop in one country and verified by a bank in another passes through several organisations, and at no point may it appear in clear. The mechanism that achieves this - translation inside hardware - is lesson two.
Keys multiply. Protecting one secret per relationship, per device and per transaction produces a hierarchy of keys which itself has to be managed, and that management is the hardest operational part of payments security.
The procedures are part of the cryptography. A key created by one person alone, on a laptop, is not protected by any algorithm. The ceremony in lesson six is as much a control as the cipher, which is why auditors examine the paperwork as closely as the configuration.
About the sources. The two standards that specify PIN block formats and interchange key management - ISO 9564 and the ANSI X9.24 family, including the TR-31 key block - are published and sold by their standards bodies. They are not free to read and nothing from them is reproduced here. What follows describes the mechanics from public material, and the authority for any precise value is the standard itself plus the PCI PIN Security Requirements and the scheme rules that apply to you.
The journey of a PIN
Follow a PIN from a keypad to the bank that checks it, and the architecture explains itself.
Entry. The cardholder keys the PIN into a device designed for the purpose: a secure PIN pad whose keypad, display and processor sit inside a tamper-responsive boundary. Approved devices are evaluated against PCI's PIN Transaction Security requirements for the point of interaction, which is why acceptance estates care which device model they deploy and at which firmware version.
Encryption, immediately. The PIN never leaves that boundary in clear. Inside the device it is combined with account data into a PIN block and encrypted under a key the device holds.
Transmission. The encrypted block travels in the authorisation message - the field discussed in Card messages and ISO 8583 - alongside the rest of the transaction.
Translation. Here is the step that surprises people. The acquirer and the issuer do not share a key, and the acquirer must not be able to read the PIN. So at each boundary a hardware security module translates the block: it decrypts under the inbound key and re-encrypts under the outbound key, entirely inside the module, with the clear PIN existing only within that protected boundary for microseconds.
Verification. The issuer, or the chip in an offline transaction, checks the PIN - lesson seven - and the answer, not the PIN, travels back.
One more step belongs in that journey, because it is where estates differ. Between the device and the acquirer there may be a point-to-point encryption arrangement, in which the whole payment payload - not only the PIN - is encrypted in the device and decrypted only in a protected environment at the far end. It narrows what the merchant's own systems ever see, which is why PCI maintains a separate programme for it, and it changes an assessment's scope rather than removing the need for one.
Two properties of this design are worth naming because they are what make it work.
No single party holds everything. The merchant has the ciphertext and no key. The acquirer can translate but not reveal. Only the issuer can verify. A breach at one point does not yield PINs.
The clear PIN exists only inside hardware, ever. That is the sentence to remember, and the test to apply to any proposed change: if a design would let a PIN exist in clear in software, in memory it shares with anything else, or in a log, the design is wrong regardless of how well the rest is built.
PIN blocks, and why the format matters
A PIN block is not an encrypted PIN. It is an encrypted structure that combines the PIN with other data, and the reason is an attack that the naive design invites.
The naive design. Encrypt the four digits on their own with a fixed key. Now the same PIN always produces the same ciphertext, so an attacker with a table of observed blocks learns which cardholders share a PIN, and can replay one customer's block against another's account.
The fix. Combine the PIN with account-specific data before encrypting, so the same PIN on two different accounts produces different ciphertext, and a block captured for one account is useless against another. That combination, its padding and its field layout are what a format specifies.
The formats are defined in ISO 9564, which is sold rather than published, so this course does not reproduce them. What a practitioner needs to know is why there is more than one and why migrations happen:
Older formats bind the PIN to the account number, which works and ties the block to data that travels with it.
Newer formats are designed to resist attacks that older ones permit, including the classes of attack that exploit an oracle - a system that reveals, by its behaviour or its error messages, something about whether a guessed PIN was well formed.
Format support must match end to end. A device producing one format and a host expecting another produces verification failures that look like customers forgetting their PINs, which is precisely how such a mismatch survives in production for weeks.
Two practical rules follow.
Know which formats your estate uses, and where. Devices, switches and issuer hosts each support a set, and the intersection is what actually works. This belongs in a document, because it will be needed during a migration and nobody will remember it.
Never build anything that reports why a PIN check failed. The distinction between "wrong PIN", "malformed block" and "bad key" is useful to an engineer and useful to an attacker. One answer - verification failed - goes back to the terminal, and the detail stays in a place no caller can see.
The key hierarchy
Payment cryptography uses a hierarchy of keys, where keys protect other keys. The structure is consistent across estates, and knowing the levels by their jobs is enough to read any vendor-neutral design.
Master keys sit at the top, inside hardware, and never appear outside it. They protect everything below them. In most designs there is a local master key per hardware security module, under which that module's stored keys are encrypted.
Key-encrypting keys are shared with another organisation so that working keys can be exchanged safely. Between an acquirer and an issuer, or an institution and a scheme, this is the key agreed once, by ceremony, that lets everything else be sent electronically.
Working keys do the daily work - encrypting PIN blocks between two parties, verifying PINs, deriving card keys. They are rotated far more often than the keys above them, and they are rotated electronically precisely because the key-encrypting key exists.
Device keys and derived keys. Terminals are the hardest case: there are hundreds of thousands of them, in the hands of merchants, and a key recovered from one must not endanger the rest. The answer is unique keys per device, derived from a base key, with the derivation designed so that compromise of one device's keys reveals nothing about any other's - and in the stronger schemes, so that each transaction uses a key that is never used again.
Three principles govern all of this, and they come from public guidance rather than from vendor practice. NIST's key management recommendation exists to cover exactly this ground: "the protection that each type of key and other cryptographic information requires and methods for providing this protection", along with "the functions involved in key management".
A key has one purpose. A key used for two things lets an attacker use one function to attack the other. Key blocks exist to bind a key to its permitted use cryptographically, so a key cannot be presented to a module as something it is not.
A key has a lifetime. Generation, distribution, use, retirement, destruction - with a recorded end as well as a recorded beginning.
A key's protection must be at least as strong as what it protects. A working key sent under a weaker key-encrypting key is only as safe as the weaker one.
Hardware security modules
A hardware security module - universally shortened to HSM - is a computer whose purpose is to hold keys and perform operations with them without ever revealing them. In payments it is not optional equipment; it is where the security actually lives.
What it does. Generates keys, stores them under its own master key, performs PIN translation, verifies PINs, generates and verifies card cryptograms, and signs and verifies data - all inside a boundary that is designed to destroy its secrets rather than allow them out.
What it refuses to do. Export a clear key. Perform an operation a key is not authorised for. Continue operating when its tamper detection fires.
The standard that governs such devices is public, and worth quoting because it tells you what a certification level actually covers. FIPS 140-3 states "security requirements for cryptographic modules" and "provides four increasing, qualitative levels of security", across areas including "cryptographic module specification", "roles, services, and authentication", "physical security", "non-invasive security", "sensitive security parameter management", "self-tests" and "life-cycle assurance".
It is worth separating the two kinds of HSM a payments estate owns, because they are not interchangeable. A payment HSM implements the payment functions - PIN translation, PIN verification, card key derivation, cryptogram checking - and is certified against the payment industry's own requirements. A general-purpose HSM protects keys for anything else the institution does, such as signing or TLS. Using one where the other belongs is a finding, and procurement teams who do not know the difference buy the wrong box roughly once per estate.
Four operational realities that nobody mentions in the design review.
Capacity is finite and awkward. Modules have limited key storage and a throughput ceiling in operations per second. Payment peaks are sharp, and an estate sized for the average will fail on the busiest evening of the year.
Firmware upgrades are events. Upgrading can require re-authentication by custodians, and in some designs a reload of keys. It is planned work with a ceremony attached, not a patch window.
High availability needs identical key sets. Two modules only serve the same traffic if they hold the same keys, which makes key loading a procedure performed consistently in several places, and makes drift between them a real failure mode.
Decommissioning is a security act. A module leaving service holds keys. Zeroising it, recording that it was zeroised, and disposing of it under control is the last step of its life cycle - and the one most often skipped when hardware is replaced in a hurry.
The rule to carry: if a design requires a clear key outside a module, the design is wrong. Not risky, not a trade-off to be accepted with compensating controls: wrong, because the entire model rests on that boundary never being crossed.
Key ceremonies, and why the theatre is the control
A key ceremony is the formal procedure for creating or loading a key that cannot be sent electronically - the first key between two organisations, or a master key for a module. It looks ceremonial because the ceremony is what provides the assurance.
Two principles do the work, and they are worth stating precisely because they are often confused.
Dual control means no single person can perform the whole operation. Two custodians are required to act, each with their own authentication.
Split knowledge means no single person knows the whole secret. A key is created in two or more components, each held by a different custodian, and the key exists only when the components are combined inside the module. No custodian has ever seen the key, and none can reconstruct it alone.
Together they produce a property worth more than any algorithm choice: a single dishonest or coerced person cannot compromise the key, and a single mistaken one cannot destroy it unnoticed.
A ceremony that an assessor will accept has a recognisable shape.
A written script, prepared and reviewed in advance, listing every step in order with the expected output of each.
Named custodians with separate roles, who authenticate individually, and who are not each other's managers - because dual control between a manager and their subordinate is dual control in name only.
A witness or supervisor who observes and signs, and who performs no step.
A controlled room, with components carried in tamper-evident packaging from secure storage, and logs showing who took what from where and when.
A signed record naming the key, its purpose, its check value, the date, the people present and the result - retained for as long as the key matters, which is usually longer than the key lives.
Two failures recur, and both are found by looking at paperwork rather than at technology. The same person holding more than one component, which collapses split knowledge entirely. And a ceremony performed but not recorded, which leaves an institution unable to prove that the key it depends on was created under control - a position that is, from an assessor's point of view, indistinguishable from not having done it.
Verifying a PIN
Verification happens in one of two places, and the difference matters for both design and customer experience.
Offline, by the chip. The card itself compares the entered PIN with a value it holds and answers the terminal. No network is needed, the chip counts failures, and it blocks itself when a configured limit is reached. The chip side is covered in EMV, chip and contactless.
Online, by the issuer. The encrypted PIN block reaches the issuer, where a hardware security module verifies it. The institution does not store PINs to do this: it stores a value derived from the PIN and the account, computed under a verification key, and checks that the derived value matches. The clear PIN exists only inside the module, for an instant.
That derived-value design is the heart of online verification, and it has three consequences.
A compromise of the issuer's database does not yield PINs, because the stored value cannot be reversed without the verification key, which lives in hardware.
A verification key is a very high-value key. With it, offline attacks against stored values become feasible, which is why these keys are generated by ceremony, never leave hardware, and are rotated as a major planned exercise.
Changing a PIN is a cryptographic operation, not a database update. The new value is computed inside a module, which is why PIN change at an ATM or in an app has a different failure profile from an ordinary account change.
Then the practicalities, which produce most customer contact.
Delivery of a new PIN is either a mailer printed in a controlled environment and never seen by staff, or a cardholder-selected PIN set through an authenticated channel. The second removes a physical process and moves the risk into the authentication of that channel, which is where attention belongs.
A blocked PIN is normal and recoverable. The chip blocks after consecutive failures; the issuer can unblock it remotely by script, as the EMV course describes. Institutions that reissue cards instead are paying for a capability they already have.
Never reveal a PIN to anybody, including the cardholder's own bank staff. It is not retrievable by design, and any process that appears to retrieve one is a finding rather than a service.
What an assessor looks for
PIN security is one of the most heavily assessed areas in payments, and the assessment has a defined shape. Knowing what it examines is the cheapest way to be ready for it.
The standards in play. PCI's PIN Security Requirements cover "the secure management, processing, and transmission of personal identification numbers (PINs) and associated cryptographic keys", and PCI SSC maintains a qualification for assessors specifically for this area - Qualified PIN Assessors, recognised "to perform independent assessments of environments where PINs are processed against the PIN Security Requirements". Devices are evaluated separately under the PIN Transaction Security programme for the point of interaction. Scheme rules sit on top and may require an assessment at a stated frequency.
What an assessment actually examines, in the order it usually bites:
The key inventory. Every key, its purpose, its length and algorithm, where it lives, who its custodians are, when it was created and when it must be replaced. An institution that cannot produce this document has already failed the most important question, because every other control is claimed about keys nobody has listed.
Ceremony records. The scripts, the signatures, the component logs, the safe access records, the check values.
Device management. Which approved models, at which firmware, received from whom through what chain of custody, deployed where, and what happens when one is returned, repaired or lost.
Separation of duties. Who can do what in the module, with evidence that no individual can perform a complete sensitive operation alone - and that the people with that access are reviewed.
Logging and its review. Module logs showing sensitive operations, and evidence that somebody reads them.
Four findings recur across institutions, and all four are organisational rather than technical: key components kept in an ordinary drawer rather than controlled storage; one custodian holding two components; no key inventory; and keys loaded by a vendor engineer with no institutional witness or record, which means the institution cannot say who has ever held its keys.
Running it, and what to do when something goes wrong
Six practices separate an institution that controls its key estate from one that merely owns one.
Keep the inventory current, and treat it as a controlled document. It is the basis of every other control, every assessment and every incident response. One owner, a review date, and a change record.
Keep a calendar. Key expiry and planned rotation, certification renewal dates, device firmware support dates, and the assessment itself. Dates that arrive by surprise are the normal cause of emergency ceremonies, and an emergency ceremony is where mistakes happen.
Rehearse ceremonies. The first time a team performs one should not be the day a key is needed. Rehearse with test keys, including the failure paths: a custodian unavailable, a component package found open, a module rejecting a load.
Name the roles, and keep them separate from each other's management line. Custodians, witnesses, the person who holds the safe combination and the person who holds the key to the room should not collapse into one or two people, and in small institutions this takes deliberate design.
Monitor what the modules tell you. Failed authentications, tamper warnings, unusual volumes of sensitive operations. These are the earliest signals available and they are usually unmonitored.
Write the compromise plan before you need it. Suspected key compromise is the scenario the whole estate exists to make survivable, and it has to be answered in advance: which keys are affected and what else they protect; who must be told, including the schemes and the acquirer or issuer at the other end of the key; what must be rotated and in what order; what stops working while that happens; and what evidence is preserved for the investigation. An institution that has to work this out during the incident will take the slowest possible path through it.
The closing idea, which generalises past PINs: in payments cryptography, the mathematics is the part nobody gets wrong. The failures are in procedures, inventories and records - a component in a drawer, a custodian who holds two, a key nobody wrote down, a module decommissioned without being zeroised. The algorithms do their job. The institution has to do the rest, and that is what this subject is really about.
In Kenya. Card acquiring, issuing, switching and ATM operation are licensed and supervised by the Central Bank of Kenya under the National Payment System Act and the National Payment System Regulations, 2014, and the PIN security obligations that bind a particular participant come from the card schemes it belongs to - typically the PCI PIN Security Requirements and the scheme's own rules - rather than from a national cryptographic standard. Two practical consequences: an institution here is assessed against the same international requirements as anywhere else, and where a domestic switch performs PIN translation, the key relationships and ceremony records for that connection are part of the institution's own compliance position rather than the switch's alone.
Thirty questions
Answer all thirty questions, then check your answers. You need 27 out of 30 to pass and receive a certificate. If you score less, you will see which answers were right and wrong, and then go through the course again before you retake the check. Your answers, progress and times are kept only in this browser.
Your answers
Your certificate of completion
Enter your name as you want it to appear, then save the certificate as a PDF. In the print window, choose Save as PDF. A certificate is issued once per completion of the course.
Rate this course
How would you rate this course? Your rating is anonymous — just a number, with no name and no account.
Bring this to your team
Your colleagues can take this course too — it is free, needs no sign-up, and nothing they enter leaves their browser. If your institution wants the same ground covered as structured training for a team, with an instructor and your own cases, we run courses in a classroom or online for groups of ten or more.
Talk to us about training your team → See the paid courses →
Saolix does not record who takes this course, so it cannot verify these certificates. The certificate confirms completion of a free self-paced course and is not an accredited qualification.
Standards and frameworks covered
The published frameworks this course teaches toward. Saolix is not affiliated with, endorsed by or accredited by any of these bodies; naming a standard is a citation, not a claim about its author.
- PCI SSC — PIN Security: the PCI standard for the secure management, processing and transmission of PINs and associated cryptographic keys, and the Qualified PIN Assessor programme, PCI Security Standards Council document library
- NIST — FIPS 140-3, Security Requirements for Cryptographic Modules: four qualitative security levels, physical security, sensitive security parameter management and self-tests, NIST SP 800-57 Part 1 Revision 5, Recommendation for Key Management: the protection each key type requires and the functions of key management
- ISO/IEC — ISO 9564 (PIN management and security): the standard that defines PIN block formats, published and sold by ISO and deliberately not reproduced in this course
- EMVCo — EMV specifications and document library: the chip side of PIN verification
- CPMI-IOSCO — Principles for financial market infrastructures (Principle 17, operational risk)
Sources
The official documents this course relies on. Laws and guidance change, so check the current version.
- PIN Security: the PCI standard for the secure management, processing and transmission of PINs and associated cryptographic keys, and the Qualified PIN Assessor programme · PCI Security Standards Council
- PCI Security Standards Council document library · PCI Security Standards Council
- FIPS 140-3, Security Requirements for Cryptographic Modules: four qualitative security levels, physical security, sensitive security parameter management and self-tests · National Institute of Standards and Technology
- NIST SP 800-57 Part 1 Revision 5, Recommendation for Key Management: the protection each key type requires and the functions of key management · National Institute of Standards and Technology
- ISO 9564 (PIN management and security): the standard that defines PIN block formats, published and sold by ISO and deliberately not reproduced in this course · International Organization for Standardization
- EMV specifications and document library: the chip side of PIN verification · EMVCo
- Principles for operational resilience · Basel Committee on Banking Supervision, March 2021
- Principles for financial market infrastructures (Principle 17, operational risk) · Committee on Payments and Market Infrastructures and IOSCO, April 2012
- National Payment System Regulations, 2014 · Central Bank of Kenya



