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

4 years 1 month ago

Hi,

Hi,

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

BR,
Mikko

ravichandra99

4 years 1 month 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 1 month 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 1 month ago

Hi,

Hi,

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

BR,
Mikko

ravichandra99

4 years 1 month 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 1 month 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 1 month 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

  • Mon, 07/27/2026 - 12:37
    gurux.dlms.cpp 9.0.2607.2701
  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200

New forum topics

  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
  • DLMS server - serving multiple similar datasets gathered from multiple meters across distinct logical addresses
More

Who's new

  • cWYHszETmudslY…
  • Aij
  • vondamc1
  • JosephNok
  • IUJbutxeSTSNcNRN
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin