Codec - Accessing DevEUIs and Decryption

Hi,

I potentially (TBC, but very likely) have a need to decrypt then decode a payload provided by a device whereby the decryption scheme is based on the DevEUI and an (AES) encryption key(s) provided by the device manufacturer (this decryption is device specific and in addition to that supported by LoRa).

I have successfully written a couple of JavaScript codecs that only depended on the encoded payload and frame port using the advice provided in the below URL and posts by the community, so have some experience but am no expert.

https://www.chirpstack.io/docs/chirpstack/use/device-profiles.html#codec

The parameters provided by ChirpStack to the ‘decodeUplink’ function do not provide access to the data contained in the device event message that a decoded payload is included in (i.e. in the ‘object’ key) but do include access to Variables (but not Tags), which as outlined in the below seem to be included for purposes kind of similar for what I’m looking to do.

https://www.chirpstack.io/docs/chirpstack/use/devices.html#tags-and-variables

Could someone more experienced with writing codecs and ChirpStack please offer their opinion on if including the DevEUI and decryption key as variables for each device is the best/suggested way of going about the above, or if this sort of decryption activity should be pushed further down the line into a bespoke integration/application (this is what Orne is implying in the below topic, but this is a couple of years back so wanted to check)?

If someone does believe that this activity is suitable for a codec (which would be great as I find viewing the data in the ChirpStack user interface is very useful) and not a bespoke integration/application, could you please let me know if the codecs are allowed to import external JavaScript packages or are they restricted to using just the core elements of ES2020 (I saw the below, but this was a few years back and there didn’t seem to be a definitive conclusion)?

Many thanks,

Mat

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.