Yes, I've selected pdu and comments in Notification view but its showing Encrypted Data.
Issues may be something like if i have added multiple devices and they may have different keys, different target address, which one is used for decryption ?
i tried to decrypt data with source code but the result was not as intended.
here is what i tried :
Yes, the problem is there when i have only one meter.
This is what i receive.
May be i am doing something wrong ? Or the meter is sending something which you do not expect ?
Data downloading and other communication is all OK.
As the trace and Log data are also received in the same way.. so i was supposing the GXDLMSDirector doesn't decrypt these data before showing.
Decryption of Notification Data
Hi,
If your keys are correct decrypted data should be shown if you have selected "Pdu" and "Comments" from "View" | "Notifications"
BR,
Mikko
Decryption of Notification Data
Hi,
Yes, I've selected pdu and comments in Notification view but its showing Encrypted Data.
Issues may be something like if i have added multiple devices and they may have different keys, different target address, which one is used for decryption ?
i tried to decrypt data with source code but the result was not as intended.
here is what i tried :
public void DecryptData()
{
try
{
client.ClientAddress = 30;
client.Authentication = Authentication.HighGMAC;
client.Ciphering.BlockCipherKey = GXCommon.HexToBytes("Some key");
client.Ciphering.AuthenticationKey = GXCommon.HexToBytes("Some key");
client.Ciphering.DedicatedKey = GXCommon.HexToBytes("Some key");
client.Ciphering.SystemTitle = GXCommon.HexToBytes("Title");
client.Ciphering.Security = Security.AuthenticationEncryption;
client.UseLogicalNameReferencing = true;
int logicaladdress = Convert.ToInt32("0");
int physicaladdressint = Convert.ToInt32(1);
client.ServerAddress = GetServerAddress(logicaladdress, physicaladdressint, 1);
client.ServerAddressSize = (byte)1;
GXByteBuffer ciphertext = new GXByteBuffer();
ciphertext.Set(GXCommon.HexToBytes("D482001E3000000935ECD4CADA3280D3628ADBF6AE4CCCC2B54A33B9299F637B0C80"));
uint IC = 2357;
AesGcmParameter p = new AesGcmParameter((byte)Command.DedGetResponse, client.Ciphering.Security, IC, client.Ciphering.SystemTitle, client.Ciphering.BlockCipherKey, client.Ciphering.AuthenticationKey);
GXByteBuffer data2 = new GXByteBuffer();
byte[] data3 = GXDLMSChippering.DecryptAesGcm(p, ciphertext);
data2.Set(data3);
string Result = data2.ToString();
MessageBox.Show(Convert.ToString(Result));
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
reply.Clear();
}
}
Can you suggest ?
Decryption of Notification Data
Hi,
Do you have problems if you have only one meter? If you have several meters it might cause problems to translator.
BR,
Mikko
Decryption of Notification Data
Yes, the problem is there when i have only one meter.
This is what i receive.
May be i am doing something wrong ? Or the meter is sending something which you do not expect ?
Data downloading and other communication is all OK.
As the trace and Log data are also received in the same way.. so i was supposing the GXDLMSDirector doesn't decrypt these data before showing.
01/15/2019 3:57:46 PM
<GeneralGloCiphering>
<SystemTitle Value="474F4500007BE512" />
<CipheredService Value="3000000001B3C3A79A2F3EDD38364345044F3F5B295840F9DDC23AA4DDA70CF57C3AD6F75F5601940C5C90A7768AFDFEB9405C0B666B18BB1CF5DCAABA3A39DF4F0EB87C79E27C50FD1E22078D160F06417000736A4925779630FFFC271F6D2D4B789B03D6C14E746C3CA550FEEE90F239E150B1EF54F77A025E9A43A7DE3C65C0" />
</GeneralGloCiphering>
Client disconnected: 10.78.163.40:38042
Decryption of Notification Data
Let me add the source code of Notification window from GXDLMSDirector,
try
{
//Show as PDU.
eventsTranslator.PduOnly = NotificationPdu.Checked;
eventsData.Set((byte[])e.Data);
GXByteBuffer pdu = new GXByteBuffer();
InterfaceType type = GXDLMSTranslator.GetDlmsFraming(eventsData);
StringBuilder sb = new StringBuilder();
while (eventsTranslator.FindNextFrame(eventsData, pdu, type))
{
sb.Append(eventsTranslator.MessageToXml(eventsData));
pdu.Clear();
}
if (AutoReset.Checked)
{
EventsView.ResetText();
}
if (NotificationTimeMnu.Checked)
{
OnAddNotification(DateTime.Now.ToString() + Environment.NewLine + sb.ToString());
}
else
{
OnAddNotification(sb.ToString());
}
}
catch (Exception ex)
{
eventsData.Clear();
OnAddNotification(ex.Message);
}
I don't this only the translator will Decrypt the AES-128 Authenticated Encrypted Data ?
Decryption of Notification Data
Hi,
Data is tried to decrypt and it's shown if it succeeds on the Notify log. We'll check this and let you know later this week.
BR,
Mikko
Decryption of Notification Data
Ok,
Thanks for the response !