C.2 Algorithm execution sequence
The algorithm uses the variable internal parameters A_0, B_0, B_1 together with the private key to generate
the authentication vector T_0 using three AES-128 and two XOR operations. The algorithm execution
sequence is shown in Figure 45 below. The first four bytes of T_0 are then used to authenticate SR-SBP2801-
BLE-E telegrams.
Figure 45 – Authentication algorithm sequence
C.3 Examples
The following four chapters give step by step examples based on one actual device and 0 /1 / 2 or 4 byte of
optional data.
C.3.1 Data telegram without optional data
For this example, we consider the following telegram payload received from a SR-SBP2801-BLE-E
with the source address E2801000019B8 and security key 3DDA31AD44767AE3CE56DCE2B3CE2ABB:
0C FF DA 03 5D 04 00 00 11 B2 FA 88 FF
The last four bytes of this payload (B2 FA 88 FF) are the sender-provided signature which has to be
authenticated (compared against the signature the receiver calculates based on its own security key).
The variable input parameters are therefore the following:
Parameter
Source Address
Input Data
Input Length
Sequence Counter
Security Key
In this example
B819000015E2 (little endian representation of E2801000019B8)
0CFFDA035D04000011
0x0009
5D040000
3DDA31AD44767AE3CE56DCE2B3CE2ABB
The constant internal parameters are always the same:
Parameter
A0_Flag
B0_Flag
i
In this example
0x01 (always)
0x49 (always)
0x0000 (always)
Based on variable input data and constant internal algorithm parameters, we can now derive the following
variable internal parameters:
Parameter
Nonce
A0
B0
B1
In this example
B819000015E25D040000000000
01B819000015E25D0400000000000000
49B819000015E25D0400000000000000
00090CFFDA035D040000110000000000
We can now calculate the signature using AES128 and XOR operations.
At the time of writing, a suitable online AES calculator could be found here:
http://testprotect.com/appendix/AEScalc
Likewise, a suitable XOR calculator could be found here:
http://xor.pw/?
The execution sequence would then be as follows:
X_1 = AES128(B0, Key)
X_1 = AES128(49B819000015E25D0400000000000000, 3DDA31AD44767AE3CE56DCE2B3CE2ABB) X_1 =
41ef09792ae152ae52c671435c1f247d
X_1A = XOR(X_1, B_1)
X_1A = XOR(41ef09792ae152ae52c671435c1f247d, 00090CFFDA035D040000110000000000) X_1A =
41e60586f0e20faa52c660435c1f247d
X_2 = AES128(X1A, Key)
X_2 = AES128(41e60586f0e20faa52c660435c1f247d, 3DDA31AD44767AE3CE56DCE2B3CE2ABB)
X_2 = 8d89e733da516ae3e08f9e30184909fc
S_0 = AES128(A0, Key)
S_0 = AES128(01B819000015E25D0400000000000000, 3DDA31AD44767AE3CE56DCE2B3CE2ABB)
S_0 = 3f736fcc8bcaf2d4aabca0260fab7976
T_0 = XOR(X_2, S_0)
T_0 = XOR(8d89e733da516ae3e08f9e30184909fc, 3f736fcc8bcaf2d4aabca0260fab7976) T_0 =
b2fa88ff519b98374a333e1617e2708a
The calculated signature is formed by the first four bytes of T_0, i.e. it is B2 FA 88 FF.
The calculated signature matches the signature that was transmitted as part of the payload. This proves that
the telegram originates from a sender that possesses the same security key and the telegram content has not
been modified.
C.3.2 Data telegram with 1 byte optional data
For this example, we consider the following telegram payload received from a SR-SBP2801-BLE-E
with the source address E2801000019B8 and security key 3DDA31AD44767AE3CE56DCE2B3CE2ABB:
0D FF DA 03 62 04 00 00 10 12 B9 FE AC C1
The last four bytes of this payload (B9 FE AC C1) are the sender-provided signature which has to be
authenticated. The variable input parameters are therefore the following:
Parameter
Source Address
Input Data
Input Length
Sequence Counter
Security Key
In this example
B819000015E2 (little endian representation of E2801000019B8)
0DFFDA03620400001012
0x000A
62040000
3DDA31AD44767AE3CE56DCE2B3CE2ABB
Based on variable input data and constant internal algorithm parameters, we can now de- rive the following
variable internal parameters:
Parameter
Nonce
A0
B0
B1
In this example
B819000015E262040000000000
01B819000015E2620400000000000000
49B819000015E2620400000000000000
000A0DFFDA0362040000101200000000
The execution sequence would then be as follows:
X_1 = AES128(B0, Key)