SLUAAQ0 March   2025 BQ27Z558 , BQ27Z561 , BQ27Z561-R1 , BQ27Z561-R2 , BQ27Z746 , BQ27Z758 , BQ28Z610 , BQ28Z610-R1 , BQ34Z100-G1 , BQ34Z100-R2 , BQ4050 , BQ40Z50 , BQ40Z50-R1 , BQ40Z50-R2 , BQ40Z80 , BQ41Z50 , BQ41Z90

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Generating a Key File with BQKEYPACKAGER
    1. 1.1 SHA1 Process
      1. 1.1.1 How to Calculate SHA1 Key
    2. 1.2 SHA256 Process
    3. 1.3 ECC Process
  5. 2Programming a Key Into the Fuel Gauge With BQKEYPROGRAMMER
  6. 3Programming Keys in Production
  7. 4Summary
  8. 5References

How to Calculate SHA1 Key

Start by calculating the SHA-1 hash of the 20-byte Key F sent to the gauge, in reverse byte order of what was sent. Key F is the last 8-bytes. Key C uses same procedure. The final key is Key C appended to Key F.

Example:

If 2309BDC0A9F86B69111CA850B530339111000C47 (little endian) is for KeyF

SHA-1 hash input to find keyF: 470C0011913330B550A81C11696BF8A9C0BD0923 (big endian)

SHA-1 hash output: 8877626BD64ABC4843E43F1E42C5413DB9EDBBA2

If 330C0014913530B550A81D10696BF8A9C7BD0613 (little endian) is for KeyC

SHA-1 hash input to find keyC: 1306BDC7A9F86B69101DA850B530359114000C33 (big endian)

SHA-1 hash output: 1B8689D48F55F5B5F81D30E012DFB96B7440433C

KeyF = 42C5413DB9EDBBA2, KeyC = 12DFB96B7440433C

SHA-1 hash input for all 0’s challenge:

KeyF + KeyC + Challenge = 42C5413DB9EDBBA212DFB96B7440433C0000000000000000000000000000000000000000

Response: 1625A385F73436792FD693D727BAC6EE47291D0B

Second hash is the response of the first appended to the key:

KeyF + KeyC + Response from first hash = 42C5413DB9EDBBA212DFB96B7440433C1625A385F73436792FD693D727BAC6EE47291D0B

Response: B0BEF440CAC492FAF09604A46C2C0996512331AF

This response needs to correspond to the data received from the gauge after using an all 0’s challenge.