Information Technology Reference
In-Depth Information
3.
specify the starting position of the currency in the first two characters of the
string and the length of the complete revenue string (including the currency
code) in the third and fourth characters of the string. if you put the revenue
string at position 4 and we use the previous AMOUNT variable of Usd19.95, this
would be 0408.
4.
append a hexed 32-bit cyclic redundancy check (CrC) value to the string (this
would be 8 characters). Calculate the CrC for the entire 40-character string,
including the prefix. the resulting string should be 48 characters.
5.
encrypt the entire string using aes in CFB mode.
6.
Hex the entire encrypted data. the result should be 96 characters.
Hexing
Hexing is a form of encoding for data from a binary to a string representation, where each byte is
represented by hexadecimal value in characters.
52
Cyclic Redundancy Check (CRC)
A CRC is a type of function that takes as input a data stream of any length and produces as output
a value of a certain space, commonly a 32-bit integer. The term CRC is often used to denote either
the function or the function's output. A CRC can be used as a checksum to detect alteration of
data during transmission or storage.
Here's a detailed version 4 example, applying the steps outlined earlier:
1.
First you get the revenue amount and currency as usual, such as:
var AMOUNT='USD19.95';
this leaves us with an eight-character-long revenue and currency string value of:
USD19.95
2.
You then choose a random 40-character long string such as:
DENNIS7890123456789012345678901234567890
3.
You then position (overwrite) the revenue and currency string within the random
string anywhere you want, just not in the first four characters, like this:
DENNIS78901234567890USD19.95901234567890
in this example, we positioned it randomly at character 20 and overwrote eight
characters.
Search WWH ::




Custom Search