How to use HIGH security connection

6 posts / 0 new
Last post
taher_alfalah
How to use HIGH security connection

Hello,

I have a small issue to use the high-security level.
I fill the below code
mDevice.setAuthentication(Authentication.HIGH_GMAC);
mDevice.setPassword("55Wvl%9z");
mDevice.setSecurity(Security.AUTHENTICATION_ENCRYPTION);
mDevice.setSystemTitle( "4B464DD0055D4CE1");
mDevice.setBlockCipherKey("FEE0FEE0FEE0FEE0FEE0FEE0FEE0FEE0");
mDevice.setAuthenticationKey("FEA0FEA0FEA0FEA0FEA0FEA0FEA0FEA0");
mDevice.setClientAddress(11);
mDevice.setAddressType(HDLCAddressType.DEFAULT);
mDevice.setPhysicalAddress(16);
mDevice.setLogicalAddress(1);

but I got an error when I try to connect ("Connection is permanently
rejected, The application context name is not supported")

also, I try to add the below code part to make sure the security applies to
the client and the same result.

mClient = new GXDLMSSecureClient(true, mDevice.getClientAddress(),
serverAddress,
mDevice.getAuthentication(), mDevice.getPassword() , InterfaceType.HDLC);

mClient.getCiphering().setSystemTitle(GXCommon.hexToBytes("4B464DD0055D4CE1"));
mClient.getCiphering().setSecurity(Security.AUTHENTICATION_ENCRYPTION);
mClient.getCiphering().setSecuritySuite(SecuritySuite.AES_GCM_128);
mClient.getCiphering().setAuthenticationKey(GXCommon.hexToBytes(mDevice.getAuthenticationKey())
);
mClient.getCiphering().setBlockCipherKey(GXCommon.hexToBytes(mDevice.getBlockCipherKey())
);

Kurumi
Kurumi's picture

Hi,

There are a few reasons for this.
1. Your client address is wrong.
2. Meter is not supporting GMac.
3. Your keys are wrong.

The reason is usually one of those.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

taher_alfalah

Hi,

thank you for your prompt reply,

our meter manufacturer provided the attached file and we need to verify that the GUK is the same needed block cipher key.

kindly note that the low security passed successfully.

Image: 
Kurumi
Kurumi's picture

Hi,

You have set authentication to HIGH_GMAC. You don't need the password if you are using GMac authentication. Try to connect using the same authentication as without ciphering. Change just the ciphering to AUTHENTICATION_ENCRYPTION.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

taher_alfalah

Hi

I am using these settings and still have the same issue. ("Connection is permanently
rejected, The application context name is not supported").
the client address and the key as provided by the manufacturer.

mDevice.setManufacturer("KFM");
mDevice.setStartProtocol(StartProtocolType.IEC);
mDevice.setWaitTime(7);
mDevice.setAuthentication(Authentication.HIGH_GMAC);
mDevice.setSecurity(Security.AUTHENTICATION_ENCRYPTION);
mDevice.setSystemTitle( "4B464DD0755D4CE1");
mDevice.setAuthenticationKey("FEE0FEE0FEE0FEE0FEE0FEE0FEE0FEE0");
mDevice.setClientAddress(12);
mDevice.setAddressType(HDLCAddressType.DEFAULT);
mDevice.setPhysicalAddress(16);
mDevice.setLogicalAddress(1);
mClient.getCiphering().setSystemTitle(GXCommon.hexToBytes("4B464DD0055D4CE1"));
mClient.getCiphering().setSecurity(Security.AUTHENTICATION_ENCRYPTION);
mClient.getCiphering().setSecuritySuite(SecuritySuite.AES_GCM_128); mClient.getCiphering().setAuthenticationKey(GXCommon.hexToBytes("FEE0FEE0FEE0FEE0FEE0FEE0FEE0FEE0") );

Kurumi
Kurumi's picture

Hi,

One of the settings is wrong. Try to change HIGH_GMAC to LOW. As I told you before, I don't know is your meter supporting GMAC authentication.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi