Encrypt using MD5 in IQ

Former Member
Former Member
Hi Apologies if this has been covered in another thread but it was difficult to search as md5 is too short to search :(

I am trying to do a MD5 hash encryption on the device in a widget but have been unable to find anything in the Monkey C API docs that would allow me to do that.

Is anyone able to help me do this?

Thanks
  • I wouldn't say md5 is a strong encryption, modern computers break it in a few seconds.

    if you want to use it in connect iq you'll have to implement it yourself, this is the algorithm of md5: https://tools.ietf.org/html/rfc1321 or here in pseudocode: https://en.wikipedia.org/wiki/MD5#Algorithm
  • Former Member
    Former Member over 8 years ago
    Thanks Peter,

    Yes I know its rubbish but it's required for an API I am using.

    Thanks
  • Thanks Peter,
    Yes I know its rubbish but it's required for an API I am using.


    One way to solve this would be to first make a call to an API endpoint that will return an MD5 hash, then use that result to make the API call to the other site. The downside to this solution is that two API network requests over BLE are required and thus two potential points of failure. But it would be an easy fix. A quick Google search turn up this API: http://md5decrypt.net/en/Api/

    You could also create your own endpoint and use that to make the actual API call (to whatever site requires MD5). That way you could minimize the superfluous code within the Connect IQ app and at the same time you can control the results sent back to the watch.

    I did that with my METAR/TAF widget (and another widget that's currently in development) since the results from the third-party API call would be too big and cause out of memory errors. This also allowed me to push all the unit conversion off the device so I only need display what my own endpoint returns. It's a win-win.

    Cheers,
    Douglas