Skip to main content

Introduction

What is CardAK?

CardAK (Card Army Knife) is a command line tool created to manage MasterCard IPM (Interchange Processing Message) files and handle messages based on the ISO-8583 standard. It offers a complete suite of utilities to analyze, validate and handle interchange files.

It was born from the necessity of handling those file types which are hard to visualize and manipulate because of their format.

This tools works in a terminal in both Windows and Linux environments.

Why was CardAK created?

Working with MasterCard interchange files is not easy because of the internal structure of those files. They can be present in different formats and encodings, and the information usually contains binary data so they cannot be just opened and edited with a classical text editor.

After several years working in the development of financial software where this kind of files need to be processed and generated, we frequently face problems like errors at the time of processing one of these files because it was received in a different format as expected by our systems, or also finding a particular transaction inside a group of files, many of them containing thousands of records. Sometimes, after creating one of these files, we found that some record with incorrect data or that should not be present, was included in the file. Most of the time that implied to regenerate the full file which could take a long time to be created.

The usual solution was to use the MasterCard simulator, but it was not always available to the hole development team, and some times we could just use it only for a few hours once a week, which clearly created difficulties when trying to solve the problems.

The alternative we sometimes had was to open the file with an Hexadecimal editor, and if the modification was simple (like changing just one or two characters that didn't change the field length), it could be done but risking to corrupt the entire file, leaving it unusable.

So then surged the development of a tool as a personal initiative to help solve some of these frequent problems. That first version was created using programming languages more oriented to scripting, like Perl, shell scripts, etc.

As a personal development project and to gain experience in a young language wich was starting to become popular (Go lang), I decided to rewrite this tool using this language to both learn it and to make the tool more performant and robust. It was the beginning of a tools called FileTools.

This tool was able to perform some basic operations over different files, like being able to identify the file type and visualize its contents in a human readable way for both IPM and MPE files used by MasterCard. There was also an attempt to convert these files between formats, but it was really never tested or finished, it was just a proof of concept to solve a personal necessity to help in the development of the systems.

It was after leaving one of the companies where I worked that, having a lot of spare time for personal proyects, I decided to create a tool that could be helpful for more people facing the same problems as I had, based on my previous experience after years dealing with these files, which also seemed difficult to understand by many developers more used to just use libraries for dealing with these kind of files.

I spent two years both learning the programming language and developing a tool from scratch to implement the functionalities of that initial prototype, and in the meantime adding more options and improving others. During this phase I found many concepts in the original prototype that were not correct and also found a lot of bugs, so that was why this tool was written from scratch, and as it may visually resemble the original prototype, they are completely different under the hood.

When the product reached a stable release, I had to assign it a name. Internally, I liked the idea to create a name that could represent what it does, and being it a multi-purpose tool, I imagined it like a Swiss Army Knife but for IPM files. And so the name Card Army Knife, or shortly, CardAK