STS Association Wiki

KEN - Key Expiry Number


The Key Expiry Number is an 8 bit binary number which is used to check whether the decoder key in a payment meter has expired. The Key expiry Number represents the last 8 bits of the TID field. If the most significant 8 bits of the TID value in the token are greater that the KEN stored in the payment meter, the token is rejected with a key expiry error.

The KEN bit positons in the token field are shown below in bold - all numbers in binary format unless otherwise stated:

Class

Sub-class​

Random number​

TID​ showing KEN value bits​

Amount​

CRC​

​00 (credit token)
0000 (electricity)
0101​ (5 decimal)
110000000010101001010101 (2016/12/11 15:49)
​0010011100010000 (1000 decimal as per amount formula in IEC62055-41)
​0001100101110000​ (1970 Hex)

 

Usage

The table below shows various values of TID and the token validity given various KEN values stored in the payment meter.


 

​Key Expiry Number (storedin the payment meter)

KEN Value of token (most significant 8 bits of the 24 bit TID field)​

Token validity​

​0xff (Hexadecimal) = 255 (decimal)= 11111111 (binary)
​0x00 - 0xff (01/01/1993 - 24/11/2024 20:15 for 1993 base date)
0x00 - 0xff (01/01/2014 - 24/11/2045 20:15for 2014 base date)
0x00 - 0xff (01/01/2035- 24/11/206620:15for 2035base date)
​token accepted since TID <= KEN (all tokens accepted.Effectively KEN is disabled if set to 0xff)
​0xaa (Hexadecimal) = 170(decimal)= 10101010 (binary)


0x00 - ​0xaa (01/01/1993- 08/03/201421:20for 1993base date)

0x00 -0xaa (01/01/2014 - 08/03/2035 21:20 for 2014 base date)

0x00 - 0xaa (01/01/2035 - 08/03/2066 21:20for 2035 base date)

0xab - 0xff (23/04/201421:36- 24/11/2024 20:15 for 1993 base date)

0xab - 0xff (23/04/203521:36- 24/11/2045 20:15 for 2014 base date)

0xab - 0xff (23/04/206621:36- 24/11/206620:15 for 2035base date)
​​token accepted since TID <= KEN

token accepted since TID <= KEN

token accepted since TID <= KEN

token rejected since TID > KEN

token rejected since TID > KEN

token rejected since TID > KEN

References: IEC62055-41