Student
Professional
- Messages
- 1,671
- Reaction score
- 1,557
- Points
- 113
This guide provides a comprehensive walkthrough for programming a blank JCOP card with magnetic stripe track data (Track 1/Track 2) and PIN functionality. This process involves EMV (Europay, MasterCard, and Visa) chip card authentication and secure messaging operations.
Before proceeding, please understand:
macOS:
Linux (Ubuntu/Debian):
Example:
Example:
Expected output:
If you see a warning about using the default test key, this is normal and indicates the tool is using the default key for authentication.
ARQC Configuration:
The card must generate an ARQC (Authorization Request Cryptogram) during transactions:
DUKPT Key Derivation:
For enhanced security, DUKPT generates one-time transaction keys:
Expected output:
Expected output:
The presence of (SELECTABLE) means the installation was successful.
Once your applet is loaded, your card is still in a development state with well-known default keys. For production use, you must change the ISD keys.
Warning: This is a critical step. If you lose the new keys, you will permanently lock yourself out of managing the card.
Using the MuscleCard Applet (if applicable):
For testing with the MuscleCard applet:
Solutions:
Possible causes and solutions:
Solutions:
Solutions:
Programming a blank JCOP card with track data involves:
Important Final Notes:
If you encounter issues, check the card's ATR first, verify your keys, and ensure your reader drivers are properly installed.
Important Legal and Technical Disclaimer
Before proceeding, please understand:- This card cloning tutorial is for educational purposes only
- Many dumps available online are invalid, expired, or will be declined by modern anti-fraud systems.
Part 1: Understanding the Components
What is a JCOP Card?
JCOP (Java Card OpenPlatform) is a smart card operating system for the Java Card platform developed by IBM Zürich Research Laboratory. These cards are programmable and can be configured to emulate various card applications, including payment cards.What is a "Dump"?
In the context of this guide, a "dump" refers to magnetic stripe track data consisting of:- Track 1: Alphanumeric data containing cardholder name, account number, and other information (format: %B1234567890123456^CARDHOLDER NAME^...)
- Track 2: Numeric data containing the account number and other information (format: ;1234567890123456=...)
- PIN: Personal Identification Number associated with the card
EMV Protocols
Modern payment cards use EMV chip protocols (201, 206, 226). The success of a programmed card depends on:- The specific protocol used by the issuing bank
- The capabilities of your JCOP card
- Proper ARQC (Authorization Request Cryptogram) generation
Part 2: Required Hardware and Software
Hardware Requirements
| Component | Recommended Models | Purpose |
|---|---|---|
| JCOP Card | NXP J2A040, J2A080, JCOP21 36K/40K, JCOP41 v2.2 | Blank programmable card |
| Card Reader/Writer | Omnikey 3021, ACR38, MCR200, MSR605X | Read/write data to cards |
| Computer | Windows PC (preferred) or macOS/Linux | Run software tools |
Software Requirements
| Software | Purpose | Source |
|---|---|---|
| Java JDK 11 | Java Card development | Adoptium or OpenJDK |
| JCOP Tools/Eclipse Plugin | JCOP card development and debugging | IBM Zurich Research Laboratory |
| GlobalPlatformPro (gp.exe) | Card management and CAP file loading | GitHub |
| X2 EMV Software | EMV parameter configuration and script editing | Various sources |
| GPShell | Script-based card communication | SourceForge |
Part 3: Setting Up Your Development Environment
Step 1: Install Java JDK 11
Windows:- Download OpenJDK 11 from Adoptium
- Run the installer
- Set JAVA_HOME environment variable:
- Right-click "This PC" → Properties → Advanced System Settings → Environment Variables
- Add JAVA_HOME pointing to your JDK installation directory
- Add %JAVA_HOME%\bin to your PATH
macOS:
Bash:
brew install openjdk@11
Linux (Ubuntu/Debian):
Bash:
sudo apt install openjdk-11-jdk
Step 2: Install JCOP Development Environment
The JCOP development environment is typically set up as an Eclipse plugin:- Download Eclipse IDE (Eclipse Classic or Eclipse for Java Developers)
- Install JCOP Plugin:
- Open Eclipse → Help → Software Updates → Find and Install
- Select "Search for new features to install"
- Create a new local site pointing to your JCOP Tools directory
- Follow the installation wizard
- Create a Java Card Project:
- File → New → Project → Java Card Project
- Name your project (e.g., "TestApp")
- Select GP version and Java Card API version
- Choose template type: "Basic Java Card applet"
- Enter Package AID and Applet AID (must share first 5 bytes)
Step 3: Install GlobalPlatformPro (gp.exe)
- Download the latest gp.jar from the official GitHub repository
- Rename it to gp.exe (Windows) or create an alias (macOS/Linux)
- Place it in a dedicated folder, e.g., C:\GP on Windows
- Add this folder to your system PATH
Step 4: Install X2 EMV Software (Optional but Recommended)
X2 EMV Software provides comprehensive tools for:- Configuring JCOP for EMV transactions
- Setting up ATR2.0 for secure payment processing
- Using BP Tools for EMV parameter configuration
- Creating and editing EMV scripts
- Personalizing cards with CardP
Part 4: Understanding and Preparing Your Dump Data
Track 1 Format
Track 1 uses the following format:
Code:
%B[Primary Account Number]^[Cardholder Name]^[Expiration Date]YY[Service Code][Discretionary Data]?
Example:
Code:
%B1234567890123456^CARDHOLDER/NAME^25011234567890123456?
Track 2 Format
Track 2 uses the following format:
Code:
;[Primary Account Number]=[Expiration Date][Service Code][Discretionary Data]?
Example:
Code:
;1234567890123456=25011234567890123456?
PIN
The PIN is typically a 4-6 digit numeric code (e.g., 1234).Extracting Track Data from a Dump File
If you have a dump file containing track data:- Open the file in a text editor
- Locate the Track 1 data (starts with %B)
- Locate the Track 2 data (starts with

- Note the associated PIN
Part 5: JCOP Card Default Keys and Authentication
Default GlobalPlatform Keys
Most blank JCOP cards come with factory-default GlobalPlatform keys:| Key Type | Default Value (Hex) | ASCII Representation |
|---|---|---|
| ENC Key | 404142434445464748494A4B4C4D4E4F | @ABCDEFGHIJKLMNO |
| MAC Key | 404142434445464748494A4B4C4D4E4F | @ABCDEFGHIJKLMNO |
| KEK Key | 404142434445464748494A4B4C4D4E4F | @ABCDEFGHIJKLMNO |
Verifying Card Communication
Insert your JCOP card into the reader and run:
Bash:
gp.exe -l
Expected output:
Code:
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
ISD: A000000003000000 (OP_READY)
Privs: SecurityDomain, CardLock, CardTerminate, CardReset, CVMManagement
If you see a warning about using the default test key, this is normal and indicates the tool is using the default key for authentication.
GPShell Script for Authentication
GPShell can also be used to authenticate with the card:
Bash:
enable_trace
establish_context
card_connect
select -AID A0000000030000
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494A4B4C4D4E4F -enc_key 404142434445464748494A4B4C4D4E4F
Part 6: Writing the Dump to the JCOP Card
Method 1: Using X2 EMV Software
This is the recommended method for most users as it provides a graphical interface and specialized EMV tools.Step 1: Configure JCOP Card
- Open X2 EMV Software
- Insert your JCOP card into the reader
- Click "Detect Card" to verify communication
- Note the ATR (Answer To Reset) - for JCOP cards, it typically contains "jcop41v22m"
Step 2: Set Up ATR2.0 Configuration
ATR settings ensure the card reader and card communicate securely:- Navigate to "ATR Configuration"
- Select "ATR2.0" protocol
- Configure the ATR string to match your JCOP card
- Save the configuration
Step 3: Configure EMV Parameters Using BP Tools
BP Tools allow fine-tuning of acceptance parameters for various payment network requirements:- Open BP Tools within X2 software
- Select your EMV protocol (201, 206, or 226)
- Configure the following parameters:
- Terminal capabilities
- Application selection indicators
- Transaction limits
- Cryptogram version number
Step 4: Load Track Data
- Navigate to "Card Personalization" or "Write Data" section
- Select "Track Data" option
- Enter your Track 1 data in the Track 1 field
- Enter your Track 2 data in the Track 2 field
- Enter the PIN in the PIN field
Step 5: Configure Cryptographic Parameters
This is the most critical step for EMV compliance:ARQC Configuration:
The card must generate an ARQC (Authorization Request Cryptogram) during transactions:
- Locate "Cryptogram Settings" or "ARQC Configuration"
- Select the appropriate algorithm (typically 001 for MasterCard, 002 for Visa)
- Ensure the card has the necessary cryptographic keys pre-loaded
- Configure DUKPT (Derived Unique Key Per Transaction) if required
DUKPT Key Derivation:
For enhanced security, DUKPT generates one-time transaction keys:
- Import the Base Derivation Key (BDK)
- Set the Key Serial Number (KSN)
- Configure the key derivation method
Step 6: Create EMV Script
EMV scripts are vital for card personalization and transaction authorization:- Navigate to "Script Editor" or "EMV Scripts"
- Create a new script
- Add APDU commands for:
- Selecting the applet
- Writing track data
- Setting PIN
- Loading cryptographic keys
- Test the script using the simulator
- Save the script
Step 7: Write to Card
- Click "Write Card" or "Program Card"
- Select your EMV script
- Confirm the write operation
- Wait for completion (typically 30-60 seconds)
Method 2: Using GPShell Scripts
For advanced users who prefer command-line control, GPShell provides script-based programming.Sample GPShell Script for Loading an Applet
Create a file named program_card.txt:
Bash:
# Enable trace for debugging
enable_trace
establish_context
# Connect to the card
card_connect
# Select the Issuer Security Domain
select -AID A0000000030000
# Open secure channel with default keys
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494A4B4C4D4E4F -enc_key 404142434445464748494A4B4C4D4E4F
# Delete existing applets if needed
delete -AID D0D1D2D3D4D50101
delete -AID D0D1D2D3D4D501
# Install the CAP file
install -file your_applet.cap -nvDataLimit 500 -instParam 00 -priv 2
# Close secure channel
close_sc
# Disconnect from card
card_disconnect
release_context
Execute the GPShell Script:
Bash:
gpshell program_card.txt
Method 3: Using GlobalPlatformPro
Load and Install a CAP File
Bash:
gp.exe -install your_applet.cap
Expected output:
Code:
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
CAP loaded
Installation successful
Verify Installation
Bash:
gp.exe -l
Expected output:
Code:
Warning: no keys given, using default test key 404142434445464748494A4B4C4D4E4F
ISD: A000000003000000 (OP_READY)
PKG: A00000039742544659 (LOADED)
Applet: A000000397425446590201 (SELECTABLE)
The presence of (SELECTABLE) means the installation was successful.
Part 7: Securing Your Card (Changing Default Keys)
Once your applet is loaded, your card is still in a development state with well-known default keys. For production use, you must change the ISD keys.Generate New Keys
Create a new set of three 16-byte (32-character hex) 3DES keys:| Key Type | Example Value |
|---|---|
| ENC Key | 00112233445566778899AABBCCDDEEFF |
| MAC Key | FFEEDDCCBBAA99887766554433221100 |
| KEK Key | 01010101010101010101010101010101 |
Change Keys Using GlobalPlatformPro
Bash:
gp.exe --key-enc 00112233445566778899AABBCCDDEEFF --key-mac FFEEDDCCBBAA99887766554433221100 --key-kek 01010101010101010101010101010101
Test the New Keys
Bash:
gp.exe -l --key-enc 00112233445566778899AABBCCDDEEFF --key-mac FFEEDDCCBBAA99887766554433221100 --key-kek 01010101010101010101010101010101
Warning: This is a critical step. If you lose the new keys, you will permanently lock yourself out of managing the card.
Part 8: Verification and Testing
Verify the Write Operation
- Use your EMV software's "Read" function
- Read back the card data
- Verify that Track 1 and Track 2 data match what you wrote
- Test PIN verification
Test the Card
Using a Test Terminal:- Use a POS simulator or test terminal
- Insert the programmed card
- Enter the PIN
- Observe the transaction response
Using the MuscleCard Applet (if applicable):
For testing with the MuscleCard applet:
Bash:
# Connect to the card
muscle tokens
muscle connect 1
# Verify PIN
muscle verify 0 1234
muscle verify 1 1234
# List keys
muscle listkeys
Part 9: Troubleshooting Common Issues
Authentication Failed / Card Not Detected
Symptoms: Error messages about authentication failure or card not foundSolutions:
- Verify the card reader driver is properly installed
- Try a different USB port
- Check that the card is properly inserted
- Ensure you're using the correct default keys: 404142434445464748494A4B4C4D4E4F
- Test with gp.exe -l to verify basic communication
Transaction Declined After Writing
Symptoms: Card writes successfully but transactions are declinedPossible causes and solutions:
- Dead dump: The dump may be expired or invalid
- ARQC calculation error: Verify cryptographic parameters are correct
- Protocol mismatch: Ensure you selected the correct EMV protocol (201, 206, or 226)
- Terminal detection: The terminal may detect chip/track data mismatch
- Bank decline: The issuing bank may have declined the transaction
Software Crashes or Fails to Write
Solutions:- Ensure you're using legitimate software versions
- Reinstall the software
- Try a different USB port
- Restart your computer
- Test with a different JCOP card
Card is "Fused" or Locked
Symptoms: Cannot write to the card, error messages about card stateSolutions:
- Check the card state with gp.exe -l (should show OP_READY)
- If showing SECURED or TERMINATED, the card may be permanently locked
- Purchase cards specifically sold as "blank" or "reprogrammable"
ATR Not Recognized
Symptoms: Card reader doesn't detect the card or shows unknown ATRSolutions:
- Add the JCOP ATR to your software's configuration file
- For JCOP41 v2.2, the ATR typically contains "jcop41v22m"
- Update your PC/SC drivers
Part 10: Additional Resources
Key EMV and DUKPT Operations
The jPOS security module provides methods for EMV operations:| Operation | Method | Purpose |
|---|---|---|
| EMV ARQC Verification | verifyARQC() | Validates cryptogram from chip card |
| EMV ARPC Generation | generateARPC() | Generates response cryptogram |
| Secure Messaging MAC | generateSM_MAC() | Generates MAC for secure messaging |
| DUKPT Key Import | importPIN(KeySerialNumber) | Imports PIN with DUKPT |
| DUKPT Key Derivation | deriveDUKPTKey() | Derives one-time transaction key |
Useful Commands Reference
| Command | Purpose |
|---|---|
| gp.exe -l | List card contents |
| gp.exe -install file.cap | Install CAP file |
| gp.exe --delete AID | Delete applet by AID |
| gp.exe --key-enc KEY --key-mac KEY --key-kek KEY | Change card keys |
| gpshell script.txt | Execute GPShell script |
Conclusion
Programming a blank JCOP card with track data involves:- Setting up the proper development environment (Java JDK, JCOP Tools, GlobalPlatformPro)
- Understanding the dump data format (Track 1, Track 2, PIN)
- Authenticating with the card using default keys
- Using EMV software (X2, GPShell, or GlobalPlatformPro) to write the data
- Configuring cryptographic parameters for EMV compliance
- Securing the card by changing default keys
- Testing and verifying the programmed card
Important Final Notes:
- Always practice on test cards first
- Keep backups of your keys and configurations
- Stay updated with EMV security standards
If you encounter issues, check the card's ATR first, verify your keys, and ensure your reader drivers are properly installed.
