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. Decrypt Message With Java

Decrypt message with java

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 dyoni , 29 August, 2022
Forums
Gurux DLMS for Java

Hello,

I would like to evaluate my smart meter data with Java.

I am currently trying to decrypt the data using a sample from the operator
(https://www.netz-noe.at/Download-(1)/Smart-Meter/218_9_SmartMeter_Kunde…)

For this I used the following code.
https://www.gurux.fi/Gurux.DLMS.Secure (AES-GCM-128 AES-GCM-128)

public class DecryptDlms {

public String hexData = "68FAFA6853FF000167DB084B464D675000000981F8200000002388D5AB4F97515AAFC6B88D2F85DAA7A0E3C0C40D004535C397C9D037AB7DBDA329107615444894A1A0DD7E85F02D496CECD3FF46AF5FB3C9229CFE8F3EE4606AB2E1F409F36AAD2E50900A4396FC6C2E083F373233A69616950758BFC7D63A9E9B6E99E21B2CBC2B934772CA51FD4D69830711CAB1F8CFF25F0A329337CBA51904F0CAED88D61968743C8454BA922EB00038182C22FE316D16F2A9F544D6F75D51A4E92A1C4EF8AB19A2B7FEAA32D0726C0ED80229AE6C0F7621A4209251ACE2B2BC66FF0327A653BB686C756BE033C7A281F1D2A7E1FA31C3983E15F8FD16CC5787E6F517166814146853FF110167419A3CFDA44BE438C96F0E38BF83D98316";
public String hexKey = "36C66639E48A8CA4D6BC8B282A793BBB";
public String hexSystemTitle = "4B464D6750000009";

public void decrypt() {

try {
GXReplyData rdData = new GXReplyData();
GXReplyData rdNotify = new GXReplyData();
GXByteBuffer bbData = new GXByteBuffer();

bbData.setHexString(this.hexData);

GXDLMSSecureClient sc = new GXDLMSSecureClient(true, 1, 1, Authentication.NONE, null, InterfaceType.WRAPPER);
sc.getCiphering().setSecurity(Security.ENCRYPTION);
sc.getCiphering().setSystemTitle(GXCommon.hexToBytes(this.hexSystemTitle));
sc.getCiphering().setBlockCipherKey(GXCommon.hexToBytes(this.hexKey));

System.out.println("sc.getData : " + sc.getData(bbData, rdData, rdNotify));

System.out.println("Notify - getErrorMessage : " + rdNotify.getErrorMessage());
System.out.println("Notify - getError : " + rdNotify.getError());
System.out.println("Notify - getData : " + rdNotify.getData());
System.out.println("Notify - getPacketLength : " + rdNotify.getPacketLength());
System.out.println("Notify - getCount : " + rdNotify.getCount());

} catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException | SignatureException ex) {
Logger.getLogger(DecryptDlms.class.getName()).log(Level.SEVERE, null, ex);
}

}

}

Unfortunately I haven't received any feedback.

run:
sc.getData : false
Notify - getErrorMessage :
Notify - getError : 0
Notify - getData :
Notify - getPacketLength : 0
Notify - getCount : 0
BUILD SUCCESSFUL (total time: 0 seconds)

After many different attempts, I am now turning to you. Could you please help me here, where could my mistake be.

best regards

Profile picture for user Kurumi

Kurumi

3 years 9 months ago

Hi,

Hi,

Your meter is using WiredMBus framing, not WRAPPER. WiredMBus is implemented for java, but it's not released as open source. I'll add that to the worklist. The next version is planned to release in September.

I believe that this might be useful for you.

https://www.gurux.fi/node/18380

BR,
Mikko

dyoni

3 years 9 months ago

Hello,

Hello,

perfect thank you.
So I'm looking forward to the upcoming release.

best regards

  • 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