GithubHelp home page GithubHelp logo

ric-geek / dlms-encrypt-decrypt-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 13 KB

Simple CLI for decrypting and encripting DLMS APDU

License: MIT License

Python 100.00%
dlms python3 smartmeter cli encryption-decryption cosem smart-metering gas-meter

dlms-encrypt-decrypt-cli's Introduction

Dlms encrypt-decrypt command line tool

With this tool you can perform these operation:

  • Generate encrypted APDU
  • Decrypt APDU
  • Authenticate APDU
  • Generate encryption key

Installation

Use pip:

pip install setup.py

Use pypi:

pip install dlms-cli

Usage

Encrypt

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

dlms_cli -e 5249435249435249 80000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 c001810001000060010aff0200

Result

Encrypted/Decrypted APDU: 0de63f2331a09aa85e8830f5f3
Authentication TAG: 610d47e1e24b14e8a022aefc6a43f3a3

Decrypt

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

dlms_cli -d 5249435249435249 80000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 0de63f2331a09aa85e8830f5f3

Result

Encrypted/Decrypted APDU: c001810001000060010aff0200
Authentication TAG: 977d4d21b7255a1b681fe6b1c902a7dc

Generate authenticated data

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

dlms_cli -a 5249435249435249 00000001 454E4352595054494F4E4B45594B4559 41555448454E5449434154494F4E4B45 0de63f2331a09aa85e8830f5f3

Result

TAG: 62d423292e0fe5320370881d

Generate encryption key

Example

dlms_cli -k

Result

Encryption Key: 08f418ad55d89f38388a7e379b16353f

Dependency

cryptography

License

MIT

dlms-encrypt-decrypt-cli's People

Contributors

ric-geek avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

joaorodolfo

dlms-encrypt-decrypt-cli's Issues

-d parameter / decryption not working

Excuse me, but i'm fiddeling arount to get data out of my smartmeter and the data is encrypted.
The best program I found is your DLMS-APDU Encrypter-Decrypter. But I cannot reproduce the dlms_cli -d command from your readme.md. It seems like the code is missing from your programm. It is parsing the command line parameters key (line 64) enc (line69) and auth (line77) but the dec parameter is missing.

Maybe you can update the code so I can use it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.