Pilot pin hash decode


Hi am trying to decode pilot pin hash, its not matching. Can u help me for decoding the Pilotpin Hash in the permissionArtifact file.
here is the link i followed the method to decode pilot pin hash. link https://pycryptodome.readthedocs.io/en/latest/src/cipher/pkcs1_v1_5.html


Can you post a sample permission artifact and the public key used? Also, It would be helpful if you can include a sample script describing how you are using the library.


here i attached the image, code is to decode pilotpinHash.

. can u share the email to me i will send the public key


I’m not an expert with Python but it seems like there is a bug in your code. Perhaps the digest which you are comparing with message[-dsize:] should be derived from the original pin 1234. I suggest you write a script to first encrypt a string and then decrypt it using your function and see if you can get the script to succeed.


yes i tried that is working fine, here is code for encrypting and decrypting pilot pin hash

1st image is the code and the 2nd image is result.
Instead of encrypting a data i used permission file pilotpinhash, i decode the data but its not matching
3rd image is code and 4th image is result of the pilot pin hash.


@nihal @sidhant Can you please take a look?


Two things -

  1. The Pilot Pin is removed in the latest version of the guidance manual. See here- Revision in DGCA RPAS Guidance Manual

  2. Try passing a fixed length for the pilot pin - 32 bits for the 4 byte PIN. you should do that in the sentinel -
    sentinel = Random.new().read(32)

Lemme know if that helps


Thank you., for the npnt test pilot pin is required?


@nihal I generated a NPNT test report from the NPNT Tool in https://digitalsky.dgca.gov.in/ In the report Pilot pin is FAILED. For now pilot pin column is not required in NPNT tool. Can u clarify about Pilot pin


@sid What’s the perspective for Pilot Pin now? Can the Pilot Pin test be ignored?


Yes! The operator is responsible for locally validating the pilot.


In the NPNT test tool, pilot pin has to remove for the NPNT report. We want to share the report to DGCA so pilot pin has to remove in the NPNT Tool.


It is removed now, Please do check.