npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

dlms-crypto-tool

v0.0.1

Published

A Node.js tool for encrypting, decrypting, authenticating DLMS APDU messages, and generate encryption key

Readme

🛡️ DLMS Crypto Tool

DLMS Crypto Tool is a Node.js package and command-line interface (CLI) utility for encrypting, decrypting, generate encryption key, and authenticating DLMS APDU messages.

✨ Features

  • 🔒 Encryption: Encrypts DLMS APDU messages.
  • 🔑 Decryption: Decrypts APDU messages.
  • 🧾 Authentication: Generates authentication tags.
  • 💻 CLI Interface: Interact with the tool via a command‑line utility (dlmscli).
  • 📁 File I/O Support: Optionally load input data from files and output results to files.
  • 📝 Verbose Mode: Provides detailed logging for debugging and traceability.
  • ✅ Well-Tested: Unit tests are provided with Mocha to ensure core functionality.

🚀 Requirements

  • Node.js vs23.11.0 (tested only with this version)
  • Commander
  • Mocha if you want run Unit tests
  • npm (comes with Node.js)

📦 Installation

You can install the package globally from npm to get the CLI:

npm install -g dlms_crypto_tool

Or install it as a dependecy in your project:

npm install dlms_crypto_tool

How to use it

The package provide a CLI command called dlmscli.

🔑 Generate a Random Encryption Key

dlmscli key

🔐 Encrypt an APDU Message

System Title = 5249435249435249
Frame Counter = 80000001
Encryption Key = 454E4352595054494F4E4B45594B4559
Authentication Key = 41555448454E5449434154494F4E4B45
APDU = c001810001000060010aff0200

dlmscli encrypt 5249435249435249 80000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 c001810001000060010aff0200

Tip: Use --infile <path> to load input from a file and --outfile <path> to save the output

🔓 Decrypt an APDU Message

System Title = 5249435249435249
Frame Counter = 80000001
Encryption Key = 454E4352595054494F4E4B45594B4559
Authentication Key = 41555448454E5449434154494F4E4B45
APDU = 0de63f2331a09aa85e8830f5f3

dlmscli decrypt 5249435249435249 80000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 0de63f2331a09aa85e8830f5f3

Result

Encrypted/Decrypted APDU: c001810001000060010aff0200

🔎 Authenticate an APDU Message

System Title = 5249435249435249
Frame Counter = 00000001
Encryption Key = 454E4352595054494F4E4B45594B4559
Authentication Key = 41555448454E5449434154494F4E4B45
APDU = 0de63f2331a09aa85e8830f5f3

dlmscli auth 5249435249435249 00000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 0de63f2331a09aa85e8830f5f3

Result

TAG: 62d423292e0fe5320370881d

🧪 Running Tests

To run unit test using Mocha, follow these steps:

  1. Clone the repository and install the development dependencies:
git clone https://github.com/YourUsername/dlms-crypto-tool.git
cd dlms-crypto-tool
npm install
  1. Run tests:

npm test

🤝 Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.

  2. Create a new branch for your changes.

  3. Write tests for your modifications.

  4. Submit a pull request with a detailed explanation of your changes.

📜 License

This project is licensed under the GNU General Public License v3.0