BP-Tools: Cryptographic Calculator – Development menu
Categories
Tags
BP-Tools: Cryptographic Calculator – Development menu
Introduction
The BP-Tools set consist of applications supporting payment transaction service development, testing and benchmarking. It currently consists of following components: Cryptographic Calculator and HSM Commander.
EFTlab distributes BP-Tools under Creative Commons Legal Code Attribution-NoDerivs 3.0 Unported and completely free. This package does come with a full support and monthly releases instantly bringing new features.
This tutorial focuses on Cryptographic Calculator functionality and is provided in six separated parts as per functionality topics covered by its main menu – Generic, Cipher, Keys, Payments, EMV and Development tools. This tutorial also aspires to provide bits of basic history on algorithms in use.
Development tools
This set of tools focuses on how to make developers their work easier, when working with payment tools.
Secure Padding
This helps you to add and/or remove ZERO padding to the left to make the output data length modulo 16 equal 0. Input can be Base64 encoded or in hexadecimal form, hexadecimal for removing only.
C++ developer screen to transform various data to the code. You may add an optional cast and/or wrap the output to fit the screen or match your coding standards.
Helps to extract HEX and Binary data from a trace. For TCP dump you may want to collect the data with -XX parameter e.g. ‘$sudo tcpdump -XX port 51002’ and use the output. From BP-Sim you may just copy and paste the data from a trace.
BUT there is a difference when the ‘A-F’ character has possition greater than 5 in the input data, then we do use HSM conversion logic with following rule: for each ‘A-F’ character add 5 and make the result modulo 10. Example: Expecting decimalization table: 0123456789ABCDEF 0123456789123456 Then A would normally be decimalized as ‘1’, ‘B’->’2′, ‘C’->’3′, ‘D’->’4′, ‘E’->’5′, ‘F’->’6′ The final used rule is: A -> (1+5)%10 = 6; B -> (2+5)%10 = 7; C -> (3+5)%10 = 8; D -> (4+5)%10 = 9; E -> (5+5)%10 = 0; F -> (6+5)%10 = 1
There is an option to add an Offset to the result.
Decimalize: derivation finished **************************************** Data: 0123456789ABCDEF Decimalisation table: 0123456789012345 Offset: 0000000000000000 Decimalisation type: As Is —————————————- Decimalized Data: 0123456789012345
Finalized Data: 0123456789012345
Same result with offset value applied.
Decimalize: derivation finished **************************************** Data: 0123456789ABCDEF Decimalisation table: 0123456789012345 Offset: 1111111155555555 Decimalisation type: As Is —————————————- Decimalized Data: 0123456789012345
Finalized Data: 1234567834567890
Bit shift
The bit shifts are sometimes considered bitwise operations, because they treat a value as a series of bits rather than as a numerical quantity.
In these operations the digits are moved, or shifted, to the left or right. Registers in a computer processor have a fixed width, so some bits will be “shifted out” of the register at one end, while the same number of bits are “shifted in” from the other end; the differences between bit shift operators lie in how they determine the values of the shifted-in bits. Limitations: Binary output comes with a limitation of 64bits (trimmed), while other values are supported up to 128.
Left shift 1
Bit Shift ( << 1 ): operation finished **************************************** Data: AFFABCCB —————————————- Decimal: 2952445131 Hexa: AFFABCCB Binary: 10101111111110101011110011001011 —————————————- After Bit Shift: Decimal: 5904890262 Hexa: 15FF57996 Binary: 101011111111101010111100110010110
Right shift 3
Bit Shift ( >> 3 ): operation finished **************************************** Data: AFFABCCB —————————————- Decimal: 2952445131 Hexa: AFFABCCB Binary: 10101111111110101011110011001011 —————————————- After Bit Shift: Decimal: 369055641 Hexa: 15FF5799 Binary: 10101111111110101011110011001
Summary
In this article, we went through the functionality of Cryptographic Calculator covered by the Development Menu.
Cryptographic Calculator and other tools covered in BP-Tools suite were designed to help and assist payment industry people in their day to day tasks and make their work the most effective. Our team would be grateful if you would suggest any improvements to our applications or report completely new functionality needed. Feedback from our users like this is exactly what drives the development of its and helps us to share our experience to wide public.