F

FlexSim
ISO 8583 Simulator Manual

An ISO 8583 message simulator for payment switch testing

Application version   1.0.3
Platforms   Windows, Linux, macOS — portable, no installation
Author   Ahmed Telleb
Document date   12 September 2026

Contents

  1. Part I — Getting started
    1. 1What FlexSim is
    2. 2The pieces, and how they fit together
    3. 3Installing and starting the application
    4. 4Five-minute tour: send your first message
  2. Part II — The main window
    1. 5The toolbar
    2. 6The test suite tree
    3. 7The live log
    4. 8The status bar and the active profile
  3. Part III — Setting up
    1. 9Connection
    2. 10Keys
    3. 11Card profiles
    4. 12Track 2
    5. 13Spec profiles
    6. 14Subfields and composition
  4. Part IV — Building test cases
    1. 15Test suites
    2. 16The test case editor
    3. 17How a field gets its value
    4. 18Editing subfield values
    5. 19Importing a captured message
    6. 20Expected response rules
  5. Part V — Running messages
    1. 21Connecting and sending
    2. 22Reading the message log
    3. 23Answering requests — responder mode
    4. 24Reversals
  6. Part VI — Tools and settings
    1. 25Reference & Tools
    2. 26Settings
    3. 27Protecting the database with a master password
  7. Part VII — Worked examples
    1. 28Example 1 — A purchase with chip data
    2. 29Example 2 — Acting as the issuer host
    3. 30Example 3 — A reversal after the reply
    4. 31Example 4 — Working out a PVV by hand
  8. Appendices
    1. AGeneration methods
    2. BSubfield composition and roles
    3. CPlaceholders
    4. DFiles, folders and backups
    5. ETroubleshooting
    6. FKnown limitations in 1.0.3
    7. GGlossary

Part IGetting started

What the application is for, what it is made of, and how to get a message onto the wire in five minutes.

1What FlexSim is

FlexSim is a desktop simulator for ISO 8583, the message format card payment switches speak. You use it to build a message by hand, send it to a host over TCP, and read back exactly what came out — byte by byte, and field by field.

It is built for the two jobs that come up constantly in payment integration work:

Around those two jobs it carries the machinery that payment testing actually needs: per-switch message definitions, encrypted card and key storage, EMV cryptogram generation (ARQC and ARPC), PIN block and CVV/PVV calculation, DUKPT key derivation, and a TLV decoder.

Who this manual is for

Anyone testing against a payment switch: integration and QA engineers, certification teams, and support staff reproducing a reported problem. It assumes you know roughly what an ISO 8583 data element is; it does not assume you have used FlexSim before.

2The pieces, and how they fit together

Six things make up everything you will do in FlexSim. Getting these straight now saves a lot of confusion later.

PieceWhat it is
Spec profile The description of one switch's message format — which data elements exist, how long each one is, how it is encoded (ASCII, EBCDIC, binary), what headers wrap the message, and how the bitmap is written. Four ship with the application. One profile is active at a time, and it governs how every message is built and parsed.
Test suite A named folder of test cases. A suite belongs to one spec profile, so switching profiles changes which suites you see.
Test case One message. It records which data elements are switched on, what value each one carries, and where that value comes from. A test case can also carry a response definition (what to reply when it is answering) and a reversal definition (what to send after its request has been answered).
Card profile One card's data: PAN, expiry, service code, track 2, PIN, PIN block, CVV/CVV2/iCVV, PVV, sequence number — plus which keys that card uses. Everything sensitive is encrypted in the database.
Key A piece of key material (ZMK, ZPK, AC, SMI, SMC, PVK, CVK) held once and referenced by name from any number of card profiles.
Connection Where to send, or where to listen: host, port, client or server, timeouts.

The chain runs: a test case lives in a suite, which belongs to a spec profile. The test case may be linked to a card profile, which references keys. Sending it uses the connection.

3Installing and starting the application

3.1  What you get

FlexSim is portable. There is no installer, no registry use, and nothing to uninstall. On Windows and Linux the package contains just two items:

FlexSim.exe                 the whole application
Assets\simulator.db         the first-run template database

Unpack the archive anywhere you can write to and run FlexSim.exe. On Linux and macOS the download is a .tar.gz rather than a zip, because a zip cannot record the executable bit.

macOS

The macOS build is shipped as a FlexSim.app bundle and is not signed, so the first launch needs right-click → Open, or xattr -dr com.apple.quarantine FlexSim.app from a terminal.

3.2  Where your data is kept

Your work — cards, keys, suites, test cases, settings and the message log — is never stored next to the program. It lives in one fixed place per user:

PlatformDatabase
Windows%LocalAppData%\FlexSim\simulator.db
Linux~/.local/share/FlexSim/simulator.db
macOS~/Library/Application Support/FlexSim/simulator.db

On the very first run the bundled template is copied there. After that the template is never used for your data again, so you can delete, move or replace the program folder and keep everything.

Backing up

To back up or move your work to another machine, copy that one simulator.db file — with FlexSim closed, so nothing is left in the write-ahead log. See Appendix D.

3.3  Choosing the active spec profile

Every launch begins by asking which spec profile to use. Nothing else opens until you answer, because the profile decides how every message is built and read.

Select Active Profile window
Figure 1. The profile picker, shown at every start. Each entry gives the profile name, its description, its version and how many data elements it defines. Pick one and choose Select.

Four profiles ship with the application:

ProfileWhat it describes
123The Egyptian Banks Company NPS format — ASCII, six application headers, 74 data elements, with the framed DE-57 token buffer and the nested DE-106 TLV tree. (Older installations show this profile under its original name, EBC.)
ArksysEuronet Host-to-Host. EBCDIC throughout, except the bitmap (ASCII hex characters), DE-52 (PIN, ASCII) and DE-55 (ICC, binary). No application headers — the two-byte length header is transport framing only.
V_ProfileA Visa message definition, 94 data elements.
M_ProfileA Mastercard message definition, 129 data elements.

You are not locked in: the active profile can be changed at any time from the status bar without restarting — see section 8.

3.4  The main window

FlexSim main window
Figure 2. The main window. The toolbar across the top holds every action; the panel on the left is the test suite tree; the dark panel on the right is the live log; the bar at the bottom reports the connection state, the active spec profile and the version you are running.

4Five-minute tour: send your first message

This walkthrough gets one message out and one reply back. It uses the test cases that come with the application, so nothing needs building first. You will need something listening on a TCP port — a real test host, or any simple echo server on your own machine.

  1. Start FlexSim and pick a profile. Choose the one that matches the host you are testing against, and press Select.
  2. Set up the connection. Press Connection on the toolbar. Choose Client (connect to a server), type the host and port, and press Save. Close the window.
  3. Connect. Press Connect. The status light at the bottom-left turns green and reads Connected.
  4. Pick a test case. In the tree on the left, click a suite to open it, then click a test case. It highlights, and Send Message becomes available.
  5. Send. Press Send Message — or Ctrl+Enter. The live log shows the bytes that went out, the field-by-field breakdown of the request, and then the reply.
The live log after a send
Figure 3. A message sent and answered. With Parsed detail switched on, each message is followed by every data element it carried, named and decoded — including the EMV tags inside DE-55.
No host to test against?

Anything that accepts a TCP connection and writes the bytes back will do to prove the send path works. FlexSim frames messages with a two-byte big-endian length header followed by the payload, so a peer only needs to read two bytes, read that many more, and reply the same way.

Part IIThe main window

Everything on the one screen you will spend most of your time in.

5The toolbar

The toolbar is in two halves. On the left are the things you do to run a message; on the right are the things you set up beforehand.

5.1  Running a message (left group)

ControlWhat it does
ConnectOpens the connection using whatever the Connection window holds — dials out in client mode, starts listening in server mode.
DisconnectCloses it. Disabled until you are connected.
IterationsHow many times pressing Send repeats. Each send waits for its reply before the next one goes; a timeout stops the run. When the selected test case is a responder, this becomes how many requests to answer before disarming.
Send MessageBuilds and sends the selected test case. Ctrl+Enter does the same. If the selected case is a responder, the button is retitled Listen for Request and pressing it arms the responder instead of sending.
StopEnds the run after the message currently in flight, or disarms an armed responder.
New TestOpens an empty test case editor for the active spec profile.

5.2  Setting things up (right group)

ControlWhat it opens
Message LogEverything sent and received, stored in the database, with the hex, the ASCII and the parsed breakdown of each one.
ConnectionHost, port, client or server, timeouts.
Card DataCard profiles — PAN, expiry, track data, security values, and which keys each card uses.
Manage KeysThe shared key store the card profiles select from.
Spec ProfilesThe message definitions: fields, headers, encodings and subfield structure.
ToolsReference calculators — card values, an encoding converter, key utilities and a TLV decoder.
SettingsTheme, log files, log colours and database protection.
One window each

Card Data, Manage Keys, Connection and Message Log open at most one instance. Pressing the button again brings the existing window to the front rather than opening a second copy. All four are owned by the main window, so they close with it.

6The test suite tree

The left-hand panel lists the suites belonging to the active spec profile, and the test cases inside each one. Its three gestures are printed under the heading:

The suite context menu
Figure 4. Right-clicking a suite offers Add Test Suite, Edit Test Suite and Delete Test Suite. Right-clicking the heading rather than a suite offers only Add Test Suite.

Each test case row carries small markers summarising what it does — whether it sends or answers, and whether its reply is checked. Hovering a row spells the same thing out in words.

The tree remembers what you opened

The tree is rebuilt from scratch on every save, delete and profile switch, but which suites are open survives that. A suite you deliberately collapsed stays collapsed; the suite holding the selected test case opens when the selection moves, not on every rebuild.

7The live log

The dark panel on the right is a running commentary on everything the application does: connection state changes, each message sent and received, and any warning about why a value could not be produced.

Two controls sit above it:

ControlWhat it does
Parsed detailSwitches the field-by-field breakdown under each message on and off. With it off you get the hex and the ASCII only. The icon changes with the state, so it is readable without relying on the fill colour.
ClearEmpties the on-screen log. It does not touch the log files or the message log in the database.
The live log with parsed detail switched off
Figure 5. The same exchange with Parsed detail switched off — the framed hex and its ASCII rendering, nothing more. Useful when you want to compare raw bytes against a capture.

Everything shown here is also written to a log file on disk, unless you turn that off in Settings. The on-screen log is never trimmed automatically.

8The status bar and the active profile

The bar along the bottom shows four things: the connection state and its indicator light, the active spec profile, the version you are running, and the author.

The profile name is a button. Pressing it reopens the picker, so you can change the active spec profile without restarting.

Switching the active profile
Figure 6. The same picker as at startup, reached from the status bar.
What switching changes

Suites and test cases belong to a profile, so switching reloads the tree and drops the current test case selection. A switch is refused while a run is in progress.

Part IIISetting up

The connection, the keys, the cards and the message definitions — the material every test case is built from.

9Connection

Connection on the toolbar opens the transport settings. There is one connection record, shared by everything.

Connection setup in client mode
Figure 7. Client mode: FlexSim dials out to a host and port.
SettingMeaning
ModeClient connects out to a host. Server listens on the port and waits for the other side to dial in. Both modes can send and both can answer.
Host / IP AddressWhere to connect, in client mode. Ignored in server mode.
PortThe port to connect to, or the port to listen on.
Connect Timeout (ms)How long to wait for the TCP connection to come up before giving up.
Reconnect Delay (ms)How long to wait before retrying, when auto-reconnect is switched on.
Auto-reconnect on connection lossReopen the connection by itself if it drops.
Connection setup in server mode
Figure 8. Server mode. The client settings grey out; only the port matters.

Press Save to store the settings. Changes take effect the next time you press Connect.

Framing and TLS in version 1.0.3

The Framing & Security group is stored but is not yet applied to the transport. Every connection uses the two-byte big-endian length header regardless of the dropdown, and the Use TLS / SSL checkbox does not currently switch the connection to TLS. See Appendix F.

10Keys

Key material is held in one shared store and referenced by name. A key is entered once and any number of card profiles can point at it, so rotating a key is one edit rather than one per card.

The key manager
Figure 9. The key store. Each row shows the key type, its description, a masked value and its check value. The Filter dropdown narrows the list to one type.

10.1  Adding a key

  1. Press New.
  2. Choose the Key Type. This is what decides which dropdown on the card screen will offer it.
  3. Give it a Description. This is the name you will pick it by, so make it say which host and which environment it belongs to.
  4. Type the Key Value as hex — 32 hex characters for a double-length key, 48 for triple-length.
  5. Check the KCV shown live under the value box against the one your key custodian gave you, then press Save.
The KCV is your safety net

The check value is recomputed as you type, so a mistyped digit shows up before the key is ever used in a cryptogram. If the KCV does not match what the other side expects, the key is wrong — do not go looking for the problem in the message.

TypeUsed for
ZMKZone master key — the key other keys are exchanged under.
ZPKZone PIN key — encrypts the PIN block.
ACEMV application cryptogram master key — the root of the ARQC and ARPC chain.
SMISecure messaging integrity key.
SMCSecure messaging confidentiality key.
PVKPIN verification key — produces the PVV.
CVKCard verification key — produces CVV, CVV2 and iCVV.
Keys with matching halves are rejected

A double-length 3DES key whose two halves are identical is only as strong as single DES, and .NET refuses to use it. Such a key will save, but every cryptogram built with it will fail. Use halves that differ.

11Card profiles

Card Data holds the cards your test cases draw values from. Pick a card in the list on the left and its details fill the panel on the right.

A card profile
Figure 10. A card profile. The PAN column in the list is masked; the full value is only ever shown in the detail panel.

11.1  Card Data

FieldNotes
PANThe primary account number, 16 or 19 digits.
Expiry (YYMM)Four digits, year first.
Service CodeThree digits. Feeds the CVV calculation and track 2.
Card Sequence NumberEMV tag 5F34. Feeds the derivation of the card's unique key from the AC master key, so it must match the card.
PINThe clear PIN. Feeds the PVV and the PIN block.
PVKIPIN verification key index, 1–6. Feeds the PVV and travels in track 2.
Track 2The full track. Type it, or build it with Compose… — see section 12.
ARPC MethodHow this issuer answers a cryptogram. Method 1 encodes the decision in the response code; Method 2 encodes it in the CSU.
CSUCard Status Update, four bytes of hex. Method 2 only — the box is disabled under Method 1, where it means nothing.

11.2  Security Data and Auto Calculate

The Security Data group holds CVV, CVV2, iCVV, PIN block and PVV. You can type them, or press Auto Calculate to derive them from the card values and the selected keys.

A second PVV

There is no chip variant of the PVV the way iCVV is one of CVV — the calculation has no service code or expiry in it. A second PVV comes from a different PVKI, which is a card field of its own.

11.3  Keys

The key selection on a card profile
Figure 11. The lower part of the card panel. Each dropdown lists only keys of the matching type from the shared key store. Manage Keys jumps straight to the key manager.

These are references, not copies. Change a key's value in the key manager and every card pointing at it follows.

12Track 2

Compose… next to the Track 2 box builds the track from the values already on the card, and lets you decide what goes in it and in what order.

The track 2 composer
Figure 12. Building track 2. The PAN and the separator are pinned at the front; every other segment can be switched off or moved with the arrows. The composed track and its length are shown at the bottom, updating as you change things.
Chip transactions swap the CVV for the iCVV

When a message carries DE-55, FlexSim replaces the CVV inside DE-35 with the card's iCVV as the message is built. It rebuilds the track from the saved layout only when doing so reproduces the track being sent; otherwise it replaces the CVV in place, and if it cannot do that unambiguously it leaves the track alone and logs why.

13Spec profiles

A spec profile is the application's description of one switch's message format. It is not your data — it is a statement of how that switch expects messages to look — and it governs both how FlexSim builds a message and how it reads one back.

Spec Profiles on the toolbar opens the editor. The list on the left holds every profile; the panel on the right holds the one you have selected, in three collapsible sections.

The spec profile editor
Figure 13. The spec profile editor with Basic Information and Headers open.

13.1  Basic Information

FieldMeaning
NameWhat the profile is called in the picker and the status bar.
VersionFree text, e.g. ISO1987.
DescriptionShown under the name in the picker.
Bitmap FormatHEX writes the bitmap as hex characters; BINARY writes it as raw bytes.
MTI EncodingASCII, EBCDIC or BINARY.

13.2  Headers

Application headers that go in front of the MTI — the NPS profile has six of them, Arksys has none. Each row is a name, an encoding and a length.

Headers are not the length prefix

The two-byte length header at the front of every frame is transport framing and is added by the connection, not by the profile. Do not add a header row for it.

13.3  Fields

The Fields section is the bulk of a profile — one row per data element. Because a profile can hold 130 of them, two things make it workable: the filter box, and collapsing the sections above so the grid gets the whole panel.

The field grid with the panel to itself
Figure 14. Collapsing Basic Information and Headers hands the whole panel to the field grid. This is how the window makes room — there is no page scroll.
The field grid filtered to DE-55
Figure 15. The field grid, filtered to 55. The heading counts what the filter left (Fields (1 of 74)). Filtering only changes what is shown — saving, adding and deleting still act on the whole profile.
ColumnMeaning
Field #The data element number. 0 is the MTI.
NameWhat the field is called in the editors and in the parsed log.
TypeThe data type and variability: N, AN, ANS, B for fixed-length fields; LLVAR, LLLVAR for variable ones.
Max LenThe length of a fixed field, or the cap on the content of a variable one. The length prefix is added on top — it is not counted here.
EncodingHow the content goes on the wire: ASCII, EBCDIC or BINARY.
Len EncHow the length prefix of a variable field is written.
PresenceMandatory, Conditional or Optional. Advisory — it does not stop you sending.
SubsHow many subfields the field has.
CompositionHow those subfields are turned into the field's value — see section 14.
WrapperAn optional extra TLV tag wrapped around the whole composed result.
Editing a shipped profile

Changing a profile changes how every message under it is built and parsed, including every existing test case. It also means the application stops updating that profile for you: FlexSim refreshes shipped profiles when a new version brings a correction, but it never overwrites one you have edited. If you want to experiment, use Duplicate and work on the copy.

13.4  What happens to profiles when you upgrade

Installing a newer version of FlexSim does not touch your cards, keys, suites or test cases — but it does reconcile the shipped spec profiles, because a fix to a profile is a fix to the product. On the first start of a new version:

SituationWhat happens
Your copy matches what shippedNothing, silently.
The shipped profile changed and you never edited yoursYours is refreshed in place. The previous definition is written to a SpecBackups folder first.
The shipped profile changed but you edited yoursYour version is kept. A warning in the log names the profile.
A profile you do not haveAdded.
A profile you created yourselfNever touched.
A profile dropped from the new versionNever deleted — your test cases may still point at it.

A refreshed profile keeps its identity, so every suite, test case and log row that pointed at it still does. Renaming is never done either: a profile you know as EBC stays called EBC even though newer installations call the same profile 123.

14Subfields and composition

Some data elements are not a single value but a structure: DE-55 is a string of BER-TLV tags, DE-57 in the NPS profile is a counted token buffer, DE-106 is a nested TLV tree. In FlexSim these are described as subfields, and the field's value is composed from them.

Select a field in the spec editor and press Edit Subfields.

The subfield editor for DE-55
Figure 16. The subfield editor for DE-55, composing as Tlv. This window edits structure only — names, lengths, formats and nesting. Values are edited from the test case.

14.1  Composition

The Composition dropdown at the top says how the children are turned into the parent's value. It is declared, never guessed from the field number.

CompositionWhat it does
AutoThe default, and a guess: TLV if the field looks like TLV, otherwise plain concatenation. It exists so that profiles written before composition was configurable keep behaving as they did. The Resolves to column in the spec editor shows what it works out to. Set the field explicitly and the guess is bypassed.
ConcatJoin the child values exactly as entered.
FixedPositional. Each child is padded or truncated to its declared length — numeric and binary right-justified and zero-filled, everything else left-justified and space-filled.
TlvBER-TLV over the immediate children. This is what DE-55 uses.
NestedTlvBER-TLV, recursing into children that are themselves containers. An optional wrapper tag wraps the whole result — DE-106 uses E0.
TokenBufferA counted buffer: a buffer header, then for each element an element header followed by its body. This is what NPS DE-57 uses.
The subfield editor for DE-57
Figure 17. NPS DE-57 as a TokenBuffer. The Role column marks which rows are templates and which are slots the composer fills — here a BufferHeader containing a Count and a TotalLength, and an ElementHeader for each token.

14.2  Roles

A child's Role says what it contributes. This is what keeps the framing declarative — nothing is hardcoded against a particular data element.

RoleMeaning
ElementThe default. Ordinary data.
BufferHeaderThe template for the header at the front of the whole buffer.
ElementHeaderThe template for the header in front of each element.
CountA slot the composer fills with the number of elements emitted.
TotalLengthA slot filled with the length of everything after the buffer header, element headers included.
ElementIdA slot filled with the current element's identifier.
ElementLengthA slot filled with the current element's length.

14.3  Nesting

Subfields nest to any depth. A subfield that has children is a container: its value is composed from what it holds and cannot be typed directly. The grid shows the tree flattened and indented, and every row has its own Add child button.

Composition inherits: a child left on Auto takes NestedTlv under a NestedTlv parent, and Fixed under a TokenBuffer — so a profile declares it once at the top rather than on every element.

Empty elements are left out

In a token buffer, an element with no value is omitted rather than sent as padding, and the count and total length follow what was actually emitted.

Two windows with similar names

Subfield Editor (this one, reached from the spec profile editor) edits the structure of a profile's subfields. Subfields (reached from a field's Edit… button in the test case editor) edits the values of one test case. See section 18.

Part IVBuilding test cases

A test case is one message. This part covers where it lives, how each field gets its value, and how to say what a good reply looks like.

15Test suites

A suite is a named folder of test cases belonging to one spec profile. Right-click in the tree and choose Add Test Suite.

The test suite editor
Figure 18. A suite has a name and a spec profile. The profile decides which fields its test cases can use, and which active profile they appear under.

Suites are worth organising by intention rather than by message type — Network, Authorization, Financial, Reversals, Negative cases. Order matters in one specific place: when a suite is used as a set of responder rules, the rules are tried in the order the test cases sit in (section 23).

Deleting a suite

Deleting a suite deletes the test cases inside it. There is no undo.

16The test case editor

Double-click a test case in the tree to open it, or press New Test for an empty one.

The test case editor
Figure 19. The test case editor. One row per data element; ticked rows go in the message. The three dropdowns at the top right link the case to a card, a suite and a name.
An empty test case
Figure 20. A new test case. Every data element the active spec profile defines is listed, all unticked; you tick the ones this message carries.

16.1  The header

ControlMeaning
Card DataThe card profile this test case draws values from. Fields set to Card Data read from it, and it is the card whose keys are used for cryptograms.
Test Case SuiteWhich suite the case belongs to. Changing it moves the case.
Test Case NameWhat it is called in the tree and in the log.

16.2  The field grid

ColumnMeaning
EnableTick to include the field. The ticks are exactly what the message's bitmap will say.
ID / Field NameThe data element, from the active spec profile.
Type / LenThe type and length the profile declares. Read-only here — change them in the spec editor.
GenerateMethodWhere the value comes from. See section 17.
ValueThe value itself. For a field with subfields this shows the composed result and cannot be typed into.
SubfieldsAn Edit… button on fields that have subfields.
DescriptionThe profile's description of the field.

Above the grid, the search box filters by field number or name, and Select All / Deselect All tick and untick everything. Filtering only changes what is shown — it never changes what is ticked.

The field grid filtered
Figure 21. Filtering to a single field. With 130 data elements in some profiles, this is how you reach one quickly.

16.3  The footer

ControlWhat it does
Clear AllEmpties every value.
Import from HexFills the whole screen from a captured message — see section 19.
ValidateWhether this case's reply is judged at all. Off, the case still runs and still sends; its reply is simply not checked.
Expected…The rules the reply must satisfy — see section 20. Disabled when Validate is off, but the rules are kept.
Response…The reply this case sends when it is answering an incoming request — see section 23.
Reversal…The reversal this case sends once its request has been answered — see section 24.
DuplicateCopies the case, subfields and all. The usual way to make a variant.
Delete / Cancel / Save ChangesAs they read. Cancel discards everything since the window opened.

17How a field gets its value

The GenerateMethod on each row decides where the value comes from when the message is built. This is the single most important idea in the editor: a value typed into a row is only used if the method says to use it.

MethodBehaviour
StaticSend exactly what is in the Value box. The default, and the right answer for most fields.
AutoGenerate a value at send time. For an ordinary field this means random content of the right type and length. For dates, times and EMV tags it means the correct value — see below.
Card DataRead the value from the linked card profile. DE-2 takes the PAN, DE-14 the expiry, DE-23 the card sequence number, DE-35 track 2, DE-52 the PIN block. You can also pick a specific card item rather than letting the field number decide.
Echo from requestCopy the same field number out of the incoming message. Used by the responder and the reversal editor; it is deliberately absent from the request editor's menu, because a request has nothing to echo.
Copy from request fieldCopy a different field number out of the original request. This is what a reversal's original-data elements are made of. Reversal editor only.

17.1  What Auto produces

WhereValue
Any plain fieldRandom content sized to the field: digits for N, alphanumerics for AN, alphanumerics and spaces for ANS.
EMV tag 9AToday's date, YYMMDD.
EMV tag 9F21The current time, HHMMSS.
EMV tag 9CThe first two digits of DE-3.
EMV tag 9F02Mirrors DE-4.
EMV tag 9F36The application transaction counter, four hex digits, stepped on each use and wrapping FFFF to 0001. Needs a linked card.
EMV tag 9F26The ARQC, computed from the card's AC key. Needs a linked card with an AC key.
Any other EMV tagRandom hex sized to the tag.
Order of resolution

Plain fields are resolved before composite ones, so 9F02 and 9C can read the DE-4 and DE-3 values that were just produced. Anything that could not be produced — an ARQC with no card, a Copy with no source picked — is left out and logged, never sent empty.

17.2  Placeholders

Any value can contain placeholders, substituted when the message is built. They work with Static, so you can mix fixed text and generated parts.

PlaceholderBecomes
{{DATE}}Now, as MMDDhhmmss
{{TIME}}Now, as hhmmss
{{YYYYMMDD}}Today, as yyyyMMdd
{{STAN}}A random six-digit trace number
{{CARD.PAN}}The linked card's PAN
{{CARD.EXPIRY}}Its expiry
{{CARD.TRACK2}}Its track 2
{{CARD.CVV}}Its CVV
{{CARD.PVV}}Its PVV
{{CARD.PVKI}}Its PVKI

18Editing subfield values

A field with subfields shows its composed value in the grid and cannot be typed into. Press Edit… in its Subfields column to open the values window.

The subfield values window
Figure 22. DE-55's subfields for one test case. The box at the top shows the composed field value and updates as you edit; the footer counts how many subfields are contributing and how long the result is.
Lengths in DE-55 are in hex characters

The Len column for an EMV tag counts hex characters, which is twice the byte count. A tag documented as 8 bytes shows as 16.

19Importing a captured message

Instead of ticking fields one at a time, you can paste a message captured from the wire and let FlexSim take it apart. Import from Hex is available on the request, response and reversal screens.

Import message from hex
Figure 23. Paste the raw message as hex. Spaces, dashes and newlines are ignored, so a capture pasted straight out of a trace usually works as-is.

The message is parsed with the active spec profile, and the import then:

Requests and replies behave differently, on purpose

On the response and reversal screens every imported field is pinned to Static, subfield leaves included. A capture is what was on the wire; a field left on Echo, Copy, Auto or Card Data would throw the captured value away and produce a different one. On the request screen the methods are left alone, because there a field's method is a choice you make alongside its value.

20Expected response rules

Expected… defines what a good reply looks like. Every rule must hold for the case to pass.

The expected response window
Figure 24. Two rules on DE-39. Approved (DE-39 = 00) adds the rule almost every authorization test wants in one press; Add rule adds a blank row to fill in yourself.
OperatorPasses when the field…
Equalsmatches the expected value exactly
NotEqualsdiffers from it
Containscontains it anywhere
StartsWithbegins with it
Regexmatches the expected value read as a regular expression
Presentis in the reply at all (no expected value needed)
Absentis not in the reply (no expected value needed)

The Note column is free text and appears in the result, so it is worth saying why the rule exists rather than restating it.

No rules is a meaningful setting

With no rules at all, a reply that parses counts as a pass. That is deliberate — failing every unconfigured case would report nothing useful. If you do not want a case judged, untick Validate instead; the rules you have are kept for when you switch it back on.

Part VRunning messages

Getting a message onto the wire, reading what came back, and answering requests instead of sending them.

21Connecting and sending

21.1  Connect

Press Connect. In client mode FlexSim dials the host and port from the Connection window; in server mode it starts listening. The status bar reports the result.

Connected
Figure 25. Connected. The indicator at bottom-left is green, Connect is greyed out and Disconnect is live.

21.2  Send

Select a test case in the tree and press Send Message, or Ctrl+Enter. What happens next, in order:

  1. Every enabled field is resolved — static values taken as they are, Auto fields generated, Card Data fields read from the linked card, placeholders substituted.
  2. Composite fields are composed from their subfields, with cryptograms computed at this point.
  3. If the message carries DE-55, the CVV inside track 2 is swapped for the card's iCVV.
  4. The message is encoded per the active spec profile, framed with its two-byte length header and written to the socket.
  5. FlexSim waits for the reply, parses it with the same profile, and logs both.
  6. If the case has a reversal defined, the reversal is sent after its delay.

Set Iterations above 1 to repeat. Each send waits for its reply before the next one goes out, and a timeout stops the run. Stop ends it after the message currently in flight.

21.3  Reading the live log

Each message in the log is written as a block: a heading line giving direction, MTI and byte count, then the hex, then the ASCII rendering, then — with Parsed detail on — every data element it carried. EMV tags inside DE-55 are listed with their tag numbers and names, indented under the field.

Warnings appear inline in the same stream, which is where to look when a field is missing from a message you expected it in. Typical lines say that an ARQC was requested with no card linked, that a Copy field had no source picked, or that a track could not be recomposed.

After disconnecting
Figure 26. After Disconnect. The log records the state change, so a session read back later shows where the connection ended.

22Reading the message log

The live log is cleared whenever you press Clear or restart. The message log is the permanent record, kept in the database per spec profile.

The message log
Figure 27. The message log. The list on the left is one row per message, oldest first; selecting a row shows its hex, its ASCII and its full parsed breakdown on the right.
ColumnMeaning
TimeWhen it was sent or received.
DirectionRequest or Response.
ModeCLIENT or SERVER — which side FlexSim was.
MTIThe message type indicator.
NameThe test case name for a message you sent; for one received, what it was recognised as.
LenThe payload length in bytes, excluding the framing header.

Refresh re-reads the list; Clear Log empties it for the current profile. The heading counts what is there.

Log files on disk

Separately from this, everything in the live log is mirrored to a text file (FlexSim-yyyyMMdd-NNN.log) in the Logs folder beside the database, rolling at midnight and at the size limit you set in Settings.

23Answering requests — responder mode

A test case can answer requests instead of sending one. This turns FlexSim into a small host: the other side sends you a 0200, and you reply with the 0210 you defined.

23.1  Defining the reply

Open a test case and press Response….

The response editor
Figure 28. The response editor. Tick Send to include a field and give it a value, or tick Echo to copy it straight out of the incoming request.
ControlMeaning
Response activeTurns this test case into a responder. While it is on, running the case listens instead of sending.
Response MTIThe MTI to reply with. Leave it blank to derive it from the request — 0200 is answered with 0210, 0800 with 0810.
SendInclude this field in the reply, with the value in the Value column.
EchoCopy this field from the incoming request. A field that is not in the request is left out rather than sent empty.
Echo all enabledSets every ticked field to Echo in one press — the quickest way to build a reply that mirrors the request.
Import from HexFills the screen from a captured reply, everything pinned to a fixed value.

23.2  Arming and answering

Select a responder test case in the tree. Send Message is retitled Listen for Request, and Iterations becomes how many requests to answer before disarming.

A responder test case selected
Figure 29. With a responder case selected, the toolbar's primary action changes. Press it to arm; press Stop to disarm.

23.3  A suite as a set of rules

Arming does not load just the one test case — it loads every responder case in that suite as a rule, in the order they sit in. So a suite becomes a small host that answers different requests differently.

23.4  ARPC — answering the card's cryptogram

A response field with subfields is composed properly, so a reply can carry real BER-TLV in DE-55. Inside it, tag 91 set to Auto is filled with the issuer authentication data.

Method and CSU live on the card

How an issuer answers is a property of that issuer, not of each test case, so ARPC Method and CSU are card profile fields. Set them once in Card Data.

24Reversals

A test case can send a reversal automatically once its request has been answered. Press Reversal… in the test case editor.

The reversal editor
Figure 30. The reversal editor. It has a field set of its own, with the same columns as the request — plus the two generation methods that only make sense here.
ControlMeaning
Reversal activeRunning this case sends its request, waits for the reply, then reverses it.
Reversal MTIUsually 0400. Blank derives it from the request.
Delay (seconds)How long to wait after the reply before sending. 0 sends straight away.
Card DataRead-only — the card linked to the test case. Card Data fields on the reversal read from it, exactly as on the request.
Echo all enabledSets every ticked field to Echo from request.
Import from HexFills the screen from a captured reversal, everything pinned to a fixed value.

24.1  Echo and Copy

Two generation methods exist for reversals specifically:

Subfields copy too, which is what a positional original-data element really needs. The Copy entry appears on a subfield only when the reversal editor opened the values window; it is never offered on a container, whose value is composed rather than set.

A Copy with no source is left out

A field left on Copy without a source picked is omitted from the message and logged as such — never sent empty. The editor's status line counts those separately, so you can see it before the run.

Part VITools and settings

The calculators that save a trip to a separate utility, and the preferences that change how the application looks and what it keeps.

25Reference & Tools

Tools on the toolbar opens a set of lookups and calculators in four tabs. Nothing here reads or writes the database — it is all scratch work.

25.1  Card values

Everything the Card Data screen calculates, without needing a saved card. Keys are typed in rather than picked from the key store, which keeps the tab a pure lookup.

The card values tab
Figure 31. A worked card: PAN, expiry, service code, PIN and PVKI at the top, the CVK, PVK and PIN key below, and every derived value underneath. The PVV input (TSP) line shows exactly what went into the PVV, so a mismatch against an HSM can be traced.

Each result names what it still needs until it has it — needs PAN, expiry, service code, CVK — so nothing is silently blank.

25.2  Converter

Paste hex, ASCII text, or EBCDIC hex; every reading is shown at once, so you do not have to say which one you meant.

The encoding converter
Figure 32. F0F2F0F0 read as hex is meaningless as ASCII but is 0200 in EBCDIC — the single most common thing to need when reading an EBCDIC trace.

25.3  Keys

Four key utilities on one tab.

The key tools tab
Figure 33. Check value computes the KCV of a key. Combine components XORs one component per line, which is how a key split between custodians is reassembled.
ToolWhat it does
Check valueThe KCV of a 16, 32, 48 or 64 hex character key.
Combine componentsXORs the components you paste, one per line.
Generate a keySingle (8), Double (16), Triple (24) or AES (32) bytes. DES-family keys get odd parity and never have matching halves.
Wrap under a KEK3DES-ECB — what a host means by "the ZPK under the ZMK". Shows the wrapped and unwrapped forms together.
DUKPTDerives the device's IPEK from the BDK, then the transaction and PIN keys for the counter in the KSN.
KEK wrapping and DUKPT
Figure 34. The lower half of the same tab: KEK wrapping and DUKPT derivation.
DUKPT is the PIN variant only

The MAC and data-encryption variants use different masks and are deliberately not implemented rather than guessed at — a wrong mask yields a plausible-looking key that no HSM agrees with.

25.4  TLV decoder

Paste a field value as hex and get the BER-TLV structure back, tag by tag, with the EMV tag names filled in.

The TLV decoder
Figure 35. The TLV decoder. The shape DE-55 carries, taken apart into tag, name, length and value.

26Settings

The settings window
Figure 36. Settings. Every change previews immediately; Save is what keeps it.
Preview now, keep on Save

Changes apply live so you can see them, but closing the window without saving puts everything back. An experiment cannot leak into the next run.

26.1  Appearance

Follow system, Light or Dark. The change reaches every open window immediately — no restart.

The main window in dark theme
Figure 37. The same main window in the dark theme.

26.2  Log files

SettingMeaning
Write log filesWhether the live log is mirrored to disk at all.
Maximum size per file (MB)A new file is started once the current one reaches this size. Files are named by date and sequence, e.g. FlexSim-20260729-001.log. Files also roll at midnight.
FolderWhere new files go. Use default returns to the folder beside the database; Open folder shows it in the file manager.

Changing the folder affects new files only — files already written stay where they are. A stored folder that has gone missing or become unwritable falls back to the default at startup.

26.3  Log colours

The background and text colour of the live log panel, with a preview and a contrast reading. These are yours to set and are not part of the light/dark theme.

27Protecting the database with a master password

Card data and key material are always encrypted at rest. By default the encryption key is derived from a passphrase built into the application, which means anyone with a copy of the program and your database file can read them.

Setting a master password replaces that with a key derived from your passphrase and a random salt.

The security section of settings
Figure 38. The Security section at the bottom of Settings. It sits outside the preview-and-save cycle: these actions re-encrypt the database the moment you confirm them.
Setting a master password
Figure 39. Setting a master password. Every stored card and key is re-encrypted under it, in one transaction.
There is no recovery

There is no reset, no hint and no back door. If the master password is lost, the card and key data in that database is gone. Everything else — suites, test cases, spec profiles, the message log — is not encrypted and survives, but every card and key has to be re-entered.

With a master password set, FlexSim opens to an unlock prompt instead of the main window. Card data and keys stay encrypted until it is entered.

This is test tooling, not a vault

A master password raises the bar considerably, but FlexSim is a desktop simulator and its threat model is a shared test machine, not a hostile adversary with your disk. Do not put production key material in it.

Part VIIWorked examples

Four end-to-end tasks, each one a thing people actually sit down to do.

28Example 1 — A purchase with chip data

Goal. Build a 0200 purchase for a chip card, with DE-55 carrying a real ARQC, and send it.

Set up the card and its key

  1. Open Manage Keys, press New, choose type AC, describe it (AC – UAT issuer), paste the 32-hex master key and check the KCV against what the issuer gave you. Save.
  2. Open Card Data, press New and fill in the PAN, expiry, service code and card sequence number. The sequence number matters — it goes into the card key derivation, and a wrong one produces a cryptogram the issuer rejects with no useful error.
  3. Pick your new key in the AC dropdown. Set ARPC Method to match the issuer.
  4. Press Compose… beside Track 2, check the segments and order, and press Apply. Then press Auto Calculate to fill the security values. Save.

Build the test case

  1. Right-click in the tree, Add Test Suite, name it Authorization and pick your spec profile.
  2. Press New Test. Name it Chip purchase, choose the suite, and choose your card in Card Data.
  3. Set the MTI to 0200 and tick the fields the switch expects. A typical minimum:
  4. On the DE-55 row press Edit…. Tick the tags the switch requires and give each a value, then set: Watch the composed value at the top of the window grow as you go. Press Done.
  5. Press Expected…, then Approved (DE-39 = 00), then Apply.
  6. Save Changes.

Send it

  1. Connection → client, host, port, Save.
  2. Connect.
  3. Click the test case in the tree and press Send Message.
  4. Read the parsed breakdown in the live log. Check that DE-55 lists the tags you expect and that 9F26 is not empty — if it is, the log line just above says why.

29Example 2 — Acting as the issuer host

Goal. Let someone else's terminal send you authorizations, and answer them — approving most, declining one card.

  1. ConnectionServer (listen for connections), set the port, Save.
  2. Make a suite called Issuer. The order of cases in it is the order the rules are tried, so put the specific ones first.
  3. First case — the declined card. Create a test case, tick DE-2 and give it the PAN you want declined. This is the match condition, not something that gets sent. Then press Response…: Apply, then save the case.
  4. Second case — approve everything else. Another test case, no fields ticked and a blank MTI, so it is a catch-all. Its response echoes the request and sends DE-39 = 00. If you are answering chip transactions, tick DE-55 in the response and set tag 91 to Auto, then link the case to the card so the AC key is available.
  5. Press Connect, select either responder case in the tree, set Iterations to the number of requests you want to answer, and press Listen for Request.
  6. Watch the log. For each request it names the rule that matched, or lists why each was passed over, and reports every field of the request that differed from the case's own definition.
  7. Stop disarms.

30Example 3 — A reversal after the reply

Goal. Send the purchase from Example 1, then reverse it automatically.

  1. Open the Chip purchase case and press Reversal….
  2. Tick Reversal active. Set Reversal MTI to 0400 and Delay to a few seconds if you want to see the two messages apart in the log.
  3. Tick the fields the reversal carries, then press Echo all enabled — most of a reversal is the original request repeated.
  4. For the original-data element (often DE-90), set it to Copy from request field and pick the source data element from the submenu. Do the same for its subfields if it is positional: open its Edit… window and set each child's source.
  5. Check the status line at the bottom of the reversal editor. It counts the fields that are on Copy with no source picked — those will be left out.
  6. Apply, save, and send the test case as usual. The log shows the request, the reply, the delay, then the reversal.

31Example 4 — Working out a PVV by hand

Goal. Check a PVV the host produced, without touching your saved cards.

  1. ToolsCard values.
  2. Type the PAN, the PIN and the PVKI.
  3. Paste the PVK into the PVK box.
  4. Read the PVV under Calculated.
  5. If it does not match the host, compare the PVV input (TSP) line underneath against what the host says it used. The TSP is the 11 rightmost PAN digits excluding the check digit, then the PVKI, then the first four PIN digits — and a disagreement is almost always in that construction rather than in the cipher.
Nothing here touches the database

The Tools window is a scratch pad. Values typed into it are not saved anywhere and no card or key is read or written.

AppendicesReference

Lookup tables, file locations, troubleshooting, and what this version cannot do.

Appendix A — Generation methods

MethodWhere offeredValue comes from
StaticRequest, response, reversal, subfieldsThe Value box, with placeholders substituted
AutoRequest, reversal, subfieldsGenerated at send time — see section 17.1
Card DataRequest, reversal, subfieldsThe linked card profile
Echo from requestResponse, reversalThe same field number in the incoming message
Copy from request fieldReversal (fields and subfields)A named, different field number in the original request

A value that cannot be produced is omitted and logged, never sent empty. Auto and Card Data on a container subfield do nothing — a container's value is composed from its children.

Appendix B — Subfield composition and roles

CompositionProduces
AutoTLV if the field looks like TLV, otherwise Concat. Compatibility default; prefer an explicit setting.
ConcatChild values joined as entered.
FixedEach child padded or truncated to its length. N and B right-justified, zero-filled; others left-justified, space-filled.
TlvBER-TLV over the immediate children.
NestedTlvBER-TLV recursing into container children, optionally wrapped in wrapperTag.
TokenBufferBuffer header, then per element an element header and body.
RoleMeaning
ElementData (default)
BufferHeaderTemplate for the header of the whole buffer
ElementHeaderTemplate for each element's header
CountFilled with the number of elements emitted
TotalLengthFilled with the length of everything after the buffer header, element headers included
ElementIdFilled with the element's identifier
ElementLengthFilled with the element's length

Inheritance. A child left on Auto takes NestedTlv under NestedTlv and Fixed under TokenBuffer.

Appendix C — Placeholders

PlaceholderSubstituted with
{{DATE}}Current date and time, MMDDhhmmss
{{TIME}}Current time, hhmmss
{{YYYYMMDD}}Today, yyyyMMdd
{{STAN}}Random six-digit trace number
{{CARD.PAN}}Linked card's PAN
{{CARD.EXPIRY}}Linked card's expiry
{{CARD.TRACK2}}Linked card's track 2
{{CARD.CVV}}Linked card's CVV
{{CARD.PVV}}Linked card's PVV
{{CARD.PVKI}}Linked card's PVKI

The {{CARD.*}} placeholders only substitute when the test case has a card linked; otherwise they are left in place, which makes the omission visible in the log rather than silent.

Appendix D — Files, folders and backups

ItemWhere
Database (Windows)%LocalAppData%\FlexSim\simulator.db
Database (Linux)~/.local/share/FlexSim/simulator.db
Database (macOS)~/Library/Application Support/FlexSim/simulator.db
Log filesLogs\ beside the database, unless you moved it in Settings
Spec profile backupsSpecBackups\ beside the database, written before a profile is refreshed on upgrade
First-run templateAssets\simulator.db beside the program. Read-only, used once, then only for shipped spec profiles

The first two lines of the log at every start are the two facts any support conversation needs: the version, and the database path.

[2026-09-12 09:12:18] [Information] → FlexSim 1.0.3
[2026-09-12 09:12:18] [Information] → Database: C:\Users\you\AppData\Local\FlexSim\simulator.db

Backing up

  1. Close FlexSim. The database uses a write-ahead log, so copying it while the application is running can leave the most recent changes behind.
  2. Copy simulator.db. If simulator.db-wal is present and non-empty, copy that too.

To move your work to another machine, install FlexSim there, run it once so the folder exists, close it, and drop your simulator.db over the one it made.

Appendix E — Troubleshooting

SymptomWhat to check
Connect does nothing / times outHost and port in the Connection window; whether the peer is listening; a firewall in between. In server mode nothing happens until the other side dials in.
The reply will not parseAlmost always the wrong active spec profile. Check the profile name in the status bar. Encoding is the usual culprit — an EBCDIC message read as ASCII produces the ????? ASCII line you can see in the log.
A field is missing from the messageLook in the live log just before the send. Anything that could not be produced is logged with a reason: no card linked, no key on the card, a Copy with no source.
Tag 9F26 (ARQC) is emptyThe test case has no card linked, or the card has no AC key selected.
Cryptograms fail with an unhelpful errorA 3DES key whose two halves are identical is rejected as weak. Also check the card sequence number — it goes into the key derivation.
Tag 91 (ARPC) is missing from a replyNo card, no AC key, or no DE-55 in the incoming request. The log names which.
The PVV does not match the hostCompare the TSP shown under the PVV against the host's. The PAN digits used exclude the check digit.
A field goes out padded with spacesThe profile has it as fixed-length where the switch expects a variable-length field. Change its Type to LLVAR or LLLVAR in the spec editor.
A variable field goes out with two length prefixesThe profile has a length indicator declared as a subfield and the codec is writing one. Clear the subfield — the codec adds the prefix itself.
Suites disappearedSuites belong to a spec profile. Check which profile is active in the status bar.
A corrected spec profile did not arrive on upgradeFlexSim never overwrites a profile you have edited. The startup log names any profile it skipped for that reason.
Nothing is written to the log folderCheck Write log files in Settings, and whether the chosen folder is still writable — an unwritable one falls back to the default at startup.

Appendix F — Known limitations in 1.0.3

These are things the interface appears to offer that this version does not yet do. They are listed so that time is not lost looking for a fault that is not there.

AreaCurrent behaviour
Framing dropdownThe 2-Byte Header / 4-Byte Header / TPDU / Raw choice is saved but not applied. Every connection uses the two-byte big-endian length header.
Use TLS / SSLThe checkbox and path are saved but the connection is not switched to TLS.
Suite runsThe machinery for running a whole suite and reporting pass/fail per case exists, and expected-response rules are stored and edited, but there is no button that starts a run in this build. Rules you set are kept and will apply when that returns.
Result exportCSV and HTML report export belong to the suite-run window, and are therefore not reachable either.
Reference lookupsThe Tools window has four tabs — Card values, Converter, Keys, TLV decoder. Response-code and currency lookups are not present in this version.

Appendix G — Glossary

TermMeaning
ARCAuthorisation Response Code, the issuer's answer inside the ARPC.
ARPCAuthorisation Response Cryptogram — the issuer's signed reply to the card's ARQC, carried in EMV tag 91.
ARQCAuthorisation Request Cryptogram — the card's signature over the transaction, EMV tag 9F26.
ATCApplication Transaction Counter, EMV tag 9F36. Steps on every transaction.
BDKBase Derivation Key, the root of a DUKPT scheme.
BER-TLVThe tag-length-value encoding EMV data uses.
CSUCard Status Update — four bytes carrying the issuer's decision under ARPC method 2.
CVK / CVV / iCVVCard verification key, and the values it produces. The iCVV is the chip variant, sent in a chip transaction's track 2 in place of the CVV.
DEData element — one numbered field of an ISO 8583 message.
DUKPTDerived Unique Key Per Transaction. A device holds one initial key and derives a fresh one for every transaction.
EBCDICIBM's character encoding, still used by many switches. Digit 0 is 0xF0, not 0x30.
IPEKInitial PIN Encryption Key — the per-device key derived from the BDK and the KSN.
KCVKey Check Value. A short value derived from a key, used to confirm two parties hold the same key without exchanging it.
KEKKey Encryption Key — a key used to wrap other keys for transport.
KSNKey Serial Number. Identifies a DUKPT device and carries its transaction counter.
MTIMessage Type Indicator, the four digits at the front of the message (0200, 0210, 0400, 0800…).
PVK / PVV / PVKIPIN verification key, the value it produces, and the index saying which key was used.
STANSystems Trace Audit Number, DE-11.
TSPTransformed Security Parameter — the constructed input to the PVV calculation.
ZMK / ZPKZone master key and zone PIN key. The ZPK encrypts PIN blocks; the ZMK is what a ZPK is exchanged under.

FlexSim 1.0.3 — User Manual · 12 September 2026 · Developed by Ahmed Telleb