Skip to main content

Posts

Showing posts with the label afpayments

The QCAT Standard: Understanding Byte Encodings for Length Representation

In programming, it’s common to deal with lengths or sizes of data. Depending on the size of that data, we represent its length using bytes. But how exactly does this encoding work? Let’s break it down step by step. What is a Byte? A  byte  is a unit of data that consists of 8  bits . Each bit is a binary value, meaning it can either be a  0  or a  1 . For example, if we have a sequence of 8 bits, it might look like this: 00000000 That’s a byte with all zeroes. How We Encode Lengths Using Bytes When encoding a length in bytes, we need to consider how large that length is. The larger the number, the more bytes we need to represent it. Let’s look at an example to make this clearer. Example 1: Length = 255 Let’s say we have the value  255 , and we want to encode this length in bytes. Since  255  can fit in 1 byte (8 bits), it’s simple. The binary representation of  255  is: 11111111 This is the maximum value you can store in a single by...

The QCAT Standard: Generating the QR Code

In this guide, we’ll explore how to generate the QCAT QR code by creating a custom TLV (Tag-Length-Value) structure in Kotlin. TLV encoding is commonly used in QR codes, smart cards, and other systems where data must be serialized into a compact, structured format. We'll also discuss encoding techniques, including converting date-times, durations, and ASCII values into hex format. Overview of the Code This Kotlin code focuses on generating a TLV structure that encodes various data fields such as a ticket ID, creator ID, creation timestamp, and a validity period into a hex-based format. Finally, it converts the TLV structure into a Base64 encoded string for easy transmission. The structure involves the following major steps: Hex Conversion: Converting data types like date-time, durations, and ASCII strings to hexadecimal. TLV Encoding: Wrapping each piece of data with a tag, its length, and value. Serialization: Serializing the data and converting it to a byte array for encoding....

The QCAT Standard: An Overview of the QR Code Specification

In this guide, we’ll explore the standardized format for encoding transport tickets as QR codes, designed to align with the EMV QR Code Specification for Payment Systems (EMV QRCPS), ensuring seamless integration and interoperability. General Requirements and Features The QR Code Standard meets the EMV QRCPS Consumer Presented Mode and includes several key features: Base64 Encoded Payload: Ensures compatibility across various platforms. BER-TLV Encoded Data: Facilitates efficient data transfer. Mandatory EMV Data Elements: This includes: Payload format indicator At least one application template Use of the EMV application-specific transparent template for ticket-specific data Payload Limit: Maximum payload size of 512 bytes, adhering to EMVCo requirements. EMVCo Processing Rules: Validation terminal QR Code readers must recognize codes that meet EMV specifications, ensuring security and reliability. QR Ticket Format QR Ticket Encoding The QR Code is encoded according to ASN.1 and ...

The QCAT Standard: Implementing Public Key Management System for QR Code Signing

In this guide, we’ll explore how to implement a Public Key Management System for signing QR codes, focusing on the QCAT Signature Algorithms Version 1 and 2. Key Management Overview The QR Code signature system relies on cryptographic keys and certificates to ensure the authenticity of the QR codes generated by issuers. The key players in this system are the Certificate Authority (CA) and the QR Code Ticket Issuers. 1. Certificate Authority (CA) : The CA signs the issuer’s public keys using its private key, creating a public key certificate. This certificate ensures the QR codes can be verified at validation terminals. CA uses a 2048-bit RSA key to sign the issuer’s keys, ensuring a high level of security. 2. Ticket Issuer : Each issuer generates their own public/private key pairs. The private key is used to sign QR codes, while the public key is included in the certificate signed by the CA. Validation terminals use the issuer’s public key to verify the signature on a QR code. 3. Valid...

The QCAT Standard: Revolutionizing QR Code-Based Ticketing for Public Transport

Public transportation is an essential component of modern urban life, and efficient ticketing systems are critical for keeping it running smoothly. AF Payments Inc. has introduced the QCAT standard, a comprehensive framework designed to streamline QR code-based ticketing systems, making public transportation more accessible and interoperable. Who is AF Payments Inc.? AF Payments Inc. (AFPI) is the driving force behind the QCAT standard. The company develops and operates electronic payment systems and automated fare collection solutions in the Philippines. AFPI is best known for managing the popular beep™ cards, which are widely used across the country’s public transportation networks. With a mission to create a seamless, cashless payment experience, AFPI leverages both QR code ticketing and NFC-based systems to modernize transport fare collection. As the owner and operator of the QCAT standard, AFPI is committed to enhancing the interoperability of public transport ticketing solutions,...