0
$\begingroup$

Hello I'm working in a school project and I'm trying to resolve an issue. I have a server, a BLE device and a computer. The BLE device is constantly advertising data, I'm using 7bytes of the data leaving 17 bytes left and I want to use the rest of the bytes to check the authenticity of the BLE device.

So, when a computer is capturing the packages, I need to confirm that that package is really from an authentic device. My idea is:

  1. The BLE device will sign the data (7bytes) with his private key (RSA method).
  2. As the signature is much more than the 18bytes, it will generate a Hash of the signature.
  3. The payload broadcast will result in the data (7bytes) + the hash (16/18bytes)
  4. The computer will catch the broadcast message
  5. The computer will send to the server the entire payload.
  6. The server will have the BLE device private key and will sign the data (7bytes)
  7. The server will generate the hash and will compare it
  8. If it matches the server will send a successful code otherwise an error code.

My concern is it is possible to get the private key by getting the hash of a signed message? I think it is, but I'm not sure, maybe the hash can help in the guess of the private key, I don’t know.

And, this is a good and secure solution? If not do you guys know one better? Thank you.

$\endgroup$
2
  • $\begingroup$ Does the server has the private key or the public key to verify the signature? $\endgroup$
    – kelalaka
    May 1, 2020 at 17:23
  • $\begingroup$ @kelalaka hi, the server has the private key $\endgroup$
    – Rafael
    May 1, 2020 at 18:01

1 Answer 1

2
$\begingroup$

If an RSA signature is sizably truncated, as is the case here, it can not be verified with the public key. Hence here (necessarily: deterministic) RSA signature is used as a secret-key MAC, and could (and IMHO should) be replaced by HMAC.

That said, no, there is no risk of leak of the private key, or even the lesser risk of the ability to sign. If there was, that would demonstrably be a break of the RSA signature scheme used.

More generally, given access to a black box that performs the textbook RSA private key operation $x\mapsto x^d\bmod n$, there is no known way that $d$ (or an equivalent) leaks, unless the black box has a side-channel leak.

$\endgroup$
1
  • $\begingroup$ I see, thank you. $\endgroup$
    – Rafael
    May 3, 2020 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.