lora

0.2.2 • Public • Published

Library to check and decrypt Lora PHYPayload

To install:

npm install lora

To test in node using the default appSKey and nwkSKey 2B7E151628AED2A6ABF7158809CF4F3C:

var lora = require('lora');
lora.getPayload('QAESAwKBbgACAbB2c5M9hkMWDus2m9lrqJ63NyclM+XZrkifwye9SPgA');
// should return an object with ascii: AABBCCDDEEFFGGHHIIJJKKLLMMNN

getPayload(data, nwkSKey, appSKey)

Check if the PHYPayload is valid (correct MIC) and returns an object with the decrypted payload as an object containing:

  • array: array containins the decrypted bytes
  • ascii: bytes converted to ascii
  • hex: string containing the data as hexadecimal

Parameters:

  • data: array, base64 or hex encoded PHYPayload
  • nwkSKey: network session key (default: 2B7E151628AED2A6ABF7158809CF4F3C)
  • appSKey: application session key (default: 2B7E151628AED2A6ABF7158809CF4F3C)

checkMIC(data, nwkSKey)

Check if the PHYPayload MIC (message integrity code) is correct (returns true or false).

Parameters:

  • data: array, base64 or hex encoded PHYPayload
  • nwkSKey: network session key (default: 2B7E151628AED2A6ABF7158809CF4F3C)

debug(data, nwkSKey, appSKey)

Returns an object with all the information about the PHYPayload and the corresponding hierarchy

Parameters:

  • data: array, base64 or hex encoded PHYPayload
  • nwkSKey: network session key (default: 2B7E151628AED2A6ABF7158809CF4F3C)
  • appSKey: application session key (default: 2B7E151628AED2A6ABF7158809CF4F3C)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.2
    22
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.2
    22
  • 0.2.1
    3
  • 0.2.0
    4
  • 0.1.0
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i lora

Weekly Downloads

29

Version

0.2.2

License

MIT

Last publish

Collaborators

  • lpatiny
  • targos