# BLE Unlock API - SRP error: 0x82 Bad proof of key

**URL:** <https://forums.digi.com/t/ble-unlock-api-srp-error-0x82-bad-proof-of-key/28083>\
**Category:** XBee - DigiMesh\
**Tags:** srp\
**Created:** [October 19, 2023, 5:28am UTC](https://forums.digi.com/t/ble-unlock-api-srp-error-0x82-bad-proof-of-key/28083 "2023-10-19T05:28:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armiks](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Armiks](https://forums.digi.com/u/Armiks)\
**Post date:** [October 19, 2023, 5:28am UTC](https://forums.digi.com/t/ble-unlock-api-srp-error-0x82-bad-proof-of-key/28083/1 "2023-10-19T05:28:23Z")

</div>

Hi to all of you again. I am having a problem unlocking my BLE. I will describe step by step what I am performing:

1. Bluetooth password:

```auto
password = "armiks"
username = "apiservice"

```

1. Salt from XCTU:

```auto
s = "6fc39e80"

```

1. Verifier from XCTU:

```auto
8055786FAC74B1A5AEC4631C7972FBBB688982B2708A90B519C93C20E0C2F02A066430E8B9E3459C80FE9F05DF0D579F21DB633F7936B79EC452968BA0BAFAA48B78606347992EE30F2A9EC2447D0729D46C24C96C30F849CC678E6D32DF32CAA708445E3269CA5BF7D4B65565BF3ACFA3FAF230BDB3BD46BB332839C99BC9D5

```

1. SRP (Secure Remote Password) data:  
N value (from the 1024-bit group):

```auto
EEAF0AB9 ADB38DD6 9C33F80A FA8FC5E8 60726187 75FF3C0B 9EA2314C 9C256576 D674DF74 96EA81D3 383B4813 D692C6E0 E0D5D8E2 50B98BE4 8E495C1D 6089DAD1 5DC7D7B4 6154D6B6 CE8EF4AD 69B15D49 82559B29 7BCF1885 C529F566 660E57EC 68EDBC3C 05726CC0 2FD4CBF4 976EAA9A FD5138FE 8376435B 9FC61D2F C0EB06E3

```

Value of g:

```auto
2

```

Encryption type:

```auto
sha256

```

1. My value of a:

```auto
a = "60975527 035CF2AD 1989806F 0407210B C81EDC04 E2762A56 AFD529DD DA2D4393"

```

1. The generated value of A:

```auto
61d5e490f6f1b79547b0704c436f523dd0e560f0c64115bb72557ec44352e8903211c04692272d8b2d1a5358a2cf1b6e0bfcf99f921530ec8e39356179eae45e42ba92aeaced825171e1e8b9af6d9c03e1327f44be087ef06530e69f66615261eef54073ca11cf5858f0edfdfe15efeab349ef5d76988a3672fac47b0769447b

```

1. Message to Digi Xbee (step 1):

```auto
7e00822c0161d5e490f6f1b79547b0704c436f523dd0e560f0c64115bb72557ec44352e8903211c04692272d8b2d1a5358a2cf1b6e0bfcf99f921530ec8e39356179eae45e42ba92aeaced825171e1e8b9af6d9c03e1327f44be087ef06530e69f66615261eef54073ca11cf5858f0edfdfe15efeab349ef5d76988a3672fac47b0769447b6b

```

1. Answer (step 2):

```auto
7e0086ac026fc39e8023d1ee0477476df83e6b08c9d093cd5c0d86e44e90fd7754006f185edce0ed0218844ac83d77b5a97c203542abccc5e1d235c376cad53bb8b50798c4263232174f4fbc6f4597279a80c30663e88792564cbc824ddcdfc5dfe6347e0fd3b754ea43489bd17d64f1c76f6c7065bcb1cb8990ca267e59f7bcb46522706412aa611273

```

1. Response analysis (salt: s=6fc39e80 - OK), value B:

```auto
23d1ee0477476df83e6b08c9d093cd5c0d86e44e90fd7754006f185edce0ed0218844ac83d77b5a97c203542abccc5e1d235c376cad53bb8b50798c4263232174f4fbc6f4597279a80c30663e88792564cbc824ddcdfc5dfe6347e0fd3b754ea43489bd17d64f1c76f6c7065bcb1cb8990ca267e59f7bcb46522706412aa6112

```

1. Generate x sha256(s + sha256(username + “:” + password)) value:

```auto
ec1d9c0f48a03b6dce39ca465615a3f14bba74ab113f2446a634ac48ba37b4b4

```

1. Generate the value of S (A, B, a, x):

```auto
24f1ae725e480a189380da811729e86128151ade0c0074c11caaa6b450d76b0070d6f70d44975420a23763538598e1d41a394e02ffc4c0b6f106de6c630e993ee5e9f6dd1412b9347c51a958d7364974967e1d24f91b55bdcac5022f615cffe2d94f3f4b31b4b4e4de03225810675a23cc7bf5a4f9fff339891299eab78dae38

```

1. Generate the value of M1 (A, B, a, x):

```auto
7c0bbb465b264e830fd63e980a4c16f22893e3ebc8812301649f23eacb4af571

```

1. Message to Digi Xbee (step 3):

```auto
7e00222c037c0bbb465b264e830fd63e980a4c16f22893e3ebc8812301649f23eacb4af5715c

```

1. Error response from Digi Xbee (step 4 error)

```auto
7e0002ac82d1

```

I don’t know where to look for the error. I have run the generated SRP values on two scripts and the error comes out the same.  
I would very much appreciate your help.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 20, 2023, 1:44pm UTC](https://forums.digi.com/t/ble-unlock-api-srp-error-0x82-bad-proof-of-key/28083/2 "2023-10-20T13:44:20Z")

</div>

Have you tried to simply set the value via XCTU to see if you have the same issue?

---

<div class="post-metadata">

**Author:** ![Armiks](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Armiks](https://forums.digi.com/u/Armiks)\
**Post date:** [October 30, 2023, 12:38pm UTC](https://forums.digi.com/t/ble-unlock-api-srp-error-0x82-bad-proof-of-key/28083/3 "2023-10-30T12:38:49Z")

</div>

Hi, thanks for your reply. I found a solution developed by kapetan in javascript that correctly establishes a connection with BLE.

> **[GitHub - kapetan/xbee-frame-stream: XBee frame protocol for the BLE API](https://github.com/kapetan/xbee-frame-stream)**
>
> XBee frame protocol for the BLE API. Contribute to kapetan/xbee-frame-stream development by creating an account on GitHub.
