Перейти до вмісту

EXT0010: Encrypted Gamma

Цей контент ще не доступний вашою мовою.

  • Extension dependencies: none
  • Document status: Approved (2020-02-01)

Full encryption using Gamma algorithm with single key buffer.

Uses 40-byte key, encrypts in 16-byte blocks. For each block:

  1. Calculate SHA-1 hash of key (use first 16 bytes)
  2. After each block, new key = SHA-1 hash (20 bytes) + data block before encryption (16 bytes) + next block number (4 bytes)

Block encryption (16 bytes):

  1. Permutation: For each byte 0-15 of key hash, split into tetrads (nibbles). Swap high tetrad of data block (at hash high nibble index) with high tetrad of next byte (at hash byte index). Same for low tetrad.
  2. XOR: Bitwise XOR of key hash with permutation result.

Key for block 0: SHA-1 hash of key #1 (20 bytes) + key #2 (16 bytes) + block number zeros (4 bytes).

Decryption reverses: XOR first, then reverse permutation.

Same structure as EXT000E. Devices return error 0006 for non-wrapped commands except Handshake, KeepAlive, and encryption setup.

Request/Response:

<TID> 3900 <LEN> 0018 <PAYLOAD>
<WRAPLEN> <CMD> <DATA> <CHKSUM> <PADDING>
FieldLengthDescription
WRAPLEN2 bytesLength of CMD + DATA
CMD2 bytesCommand code
DATAvariableData field
CHKSUM2 bytesByte sum of CMD + DATA
PADDINGmultiple of 16Random bytes (min 128 total)

Decryption error returned unencrypted: <TID> 3900 0004 8018 0010