Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Gurux.DLMS Python Decryption

Gurux.DLMS python decryption

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By ravichandra99 , 14 June, 2022
Forums
Gurux.DLMS

Hi Mikko

Im using gurux python, Im able to get data and its encrypted and in xml format
im unable to decrypt

rawdata is in

https://pastebin.com/W2XtWtR4

and the code im using is

from gurux_dlms import GXDLMSTranslator
from gurux_dlms import GXByteBuffer
data = "data here"
t = GXDLMSTranslator()
t.comments = True
t.systemTitle = "TRI00000".encode()
t.blockCipherKey = bytearray((0x54, 0x72, 0x69, 0x5F, 0x5F, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x63))
t.authenticationKey = bytearray((0x54, 0x72, 0x69, 0x5F, 0x5F, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x63))
t.serverSystemTitle = GXByteBuffer.hexToBytes("4142434445464748")
print(t.messageToXml(data))

Profile picture for user Kurumi

Kurumi

3 years 12 months ago

Hi,

Hi,

Can you give the raw data in hex so I can check this from the bytes?

BR,
Mikko

ravichandra99

3 years 12 months ago

This is rawdata

This is rawdata

https://pastebin.com/feNYWbnm

cipherkey, kindly check with this too - 52 45 53 5F 55 6E 69 63 61 73 74 41 73 73 63 30

ravichandra99

3 years 12 months ago

Hi

Hi

Cipher key and Authentication key are same

pls try from gurux_dlms import GXDLMSTranslator
from gurux_dlms import GXByteBuffer
data = "00 01 00 01 00 10 00 58 DB 08 41 42 43 44 45 46 47 48 4D 30 00 00 00 00 11 98 4B 30 35 F0 35 51 06 72 DA 54 93 70 8E 70 9B 3D BD 31 02 14 CE 10 A9 89 81 92 53 80 42 A9 19 D7 52 62 7B E6 70 B3 13 30 E1 53 B6 9D 0B 6D 14 8D 86 F9 D4 6F 6B C3 09 24 A8 4C 50 03 82 FF 05 77 A5 9B F1 1F CD 78"
t = GXDLMSTranslator()
t.comments = True
t.systemTitle = "TRI00000".encode()
t.blockCipherKey = bytearray(0x52, 0x45, 0x53, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x73, 0x63, 0x30))
t.authenticationKey = bytearray((0x52, 0x45, 0x53, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x73, 0x63, 0x30))
t.serverSystemTitle = GXByteBuffer.hexToBytes("4142434445464748")
print(t.messageToXml(data))

or 52 45 53 5F 55 6E 69 63 61 73 74 41 73 73 63 30 as cipher key and auth key

Profile picture for user Kurumi

Kurumi

3 years 12 months ago

Hi,

Hi,

Get the latest version (1.0.126). There was an issue with GXDLMSTranslator and ciphering.

BR,
Mikko

ravichandra99

3 years 12 months ago

In reply to Hi, by Kurumi

Hi Mikko Ihad tried with the

Hi Mikko Ihad tried with the lastest version , still im not getting decrypted data
its working with Director GUI, but not working using python,

One more thing is earlier python client command used to work , but now its also not working
im using ipv6 to connect to meter ..

ravichandra99

3 years 12 months ago

from gurux_dlms import

from gurux_dlms import GXDLMSTranslator
from gurux_dlms import GXByteBuffer
data = "00 01 00 01 00 10 00 58 DB 08 41 42 43 44 45 46 47 48 4D 30 00 00 00 00 11 98 4B 30 35 F0 35 51 06 72 DA 54 93 70 8E 70 9B 3D BD 31 02 14 CE 10 A9 89 81 92 53 80 42 A9 19 D7 52 62 7B E6 70 B3 13 30 E1 53 B6 9D 0B 6D 14 8D 86 F9 D4 6F 6B C3 09 24 A8 4C 50 03 82 FF 05 77 A5 9B F1 1F CD 78"
t = GXDLMSTranslator()
t.comments = True
t.systemTitle = "TRI00000".encode()
t.blockCipherKey = bytearray((0x52, 0x45, 0x53, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x73, 0x63, 0x30))
t.authenticationKey = bytearray((0x52, 0x45, 0x53, 0x5F, 0x55, 0x6E, 0x69, 0x63, 0x61, 0x73, 0x74, 0x41, 0x73, 0x73, 0x63, 0x30))
t.serverSystemTitle = GXByteBuffer.hexToBytes("4142434445464748")
print(t.messageToXml(data))

The above is code i had used

xml: https://pastebin.com/W2XtWtR4
encrypted: https://pastebin.com/feNYWbnm

Im stuck from last 2 weeks

Profile picture for user Kurumi

Kurumi

3 years 12 months ago

Hi,

Hi,

Your block and authentication keys are wrong. Use 54 72 69 5F 5F 5F 55 6E 69 63 61 73 74 41 73 63

BR,
Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin