6.5.4 STA: EncryptionAlgorithm07
6.5.4.1 Encryption process
The Standard Transfer Algorithm encryption process is shown in Figure 12, which comprises a key alignment process and 16 iterations of a substitution, permutation and key rotation process.
标准传输算法加密过程如图12所示,包括一个密钥对齐过程和一个替换、置换和密钥旋转过程的16次迭代。
The POSApplicationProcess gives the appropriate directive by means of the EA code in the APDU.
POSApplicationProcess通过APDU中的EA代码给出适当的指令。
6.5.4.2 Substitution process
The encryption substitution process is illustrated in Figure 13. 加密替换过程如图13所示。
There is a 4-bit substitution process for each of the 16 nibbles in the data stream. The substitution table used is one of two 16-value substitution tables and is dependent on the most significant bit setting of the corresponding nibble in the key. A sample substitution table is given in Table 44.
对于数据流中的16个蚕食,每个都有一个4位替换过程。这里使用的替换表是两个16值替换表中的一个,它取决于键中对应小块的最高位设置。表44给出了一个样本替换表。
The first entry in the substitution table corresponds to entry position 0 and the last to entry position 15.
替换表中的第一个条目对应于条目位置0,最后一个条目对应于条目位置15。
Use the value of the data nibble as an index to an entry position in the substitution table; then replace the nibble value with the value from the substitution table found at that entry position. For example: if the value of the data nibble is 8 and we are using SubstitutionTable1 , then the entry at position 8 is the value 14, thus replace the data nibble value with the value 14.
使用数据块的值作为替换表项位置的索引。然后用在该入口位置找到的替换表中的值替换nibble值。例如:如果数据nibble的值是8,而我们正在使用SubstitutionTable1,那么位置8的元素的值是14,因此将数据nibble的值替换为14。
6.5.4.3 Permutation process
The encryption permutation process is illustrated in Figure 14.加密排列过程如图14所示。
A sample permutation table is given in Table 45.表45给出了一个示例排列表。
The first entry in the permutation table corresponds to the least significant bit position 0 in the DataBlock and the last entry to the most significant bit position 63 in the DataBlock.
排列表中的第一个表项对应于DataBlock中最低有效位0,最后一个表项对应于DataBlock中最高有效位63。
Use the bit position of the source DataBlock as an index into the permutation table; then use the value found in the permutation table at that entry position as a pointer to the bit position in the destination DataBlock. For example: for the source DataBlock bit position 7 corresponds to the value 2 in the permutation table, thus the value of bit 7 from the source DataBlock is placed in bit position 2 in the destination DataBlock.
使用源DataBlock的位位置作为置换表的索引;然后使用在该入口位置的置换表中找到的值作为指向目标DataBlock中的位位置的指针。例如:对于源DataBlock的位7对应于置换表中的值2,因此源DataBlock的位7的值被放在目的DataBlock的位2上。