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. Node
  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

4 years 5 months ago

Hi,

Hi,

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

BR,
Mikko

ravichandra99

4 years 5 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

4 years 5 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

4 years 5 months ago

Hi,

Hi,

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

BR,
Mikko

ravichandra99

4 years 5 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

4 years 5 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

4 years 5 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

  • Thu, 11/19/2026 - 10:57
    Gurux.DLMS.Python 1.0.204
  • Thu, 11/19/2026 - 10:12
    gurux.dlms.c 9.0.2611.1901
  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101

New forum topics

  • Landis E650 meter reading over DLMS
  • class_id = 40, version = 2, pushsetup Unparsed data frame
  • GXObisValueItem entries without MaskSize appear to be interpreted as bit flags
  • CheckedListBox incorrectly selects GXObisValueItem Value=0 for non-zero values
  • UIValueType=TextBox is rendered as CheckedListBox when Values are defined
More

Who's new

  • Sayang
  • q80435762@gmail.com
  • ONCAK
  • Berhasil
  • ratirvivege1979
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin