Comments (13)
One of the main problem is to choose an aes implementation.
from knx.
Found https://github.com/kokke/tiny-AES-c .
Next step implement example encryption steps above with tiny-AES-c (or any other small c(++) aes lib)
from knx.
@thelsing
Looks good.
I will try to implemented the encryption/decryption with tiny-AES based on the example.
The example shows an TP1 extended frame telegram:
- A_PropertyValueWrite() to object index 5, PID: 0x35(53)
- SRC: FF67, DST: FF00 (DST seems to be line coupler, because of 0x00)
ADATA is "associated data" and PDATA is "payload data". Terms used within AES-CCM.
from knx.
KNX Data Secure also does NOT use a new mask version.
Instead the presence of the "Security Interface Object" indicates the support KNX Data Secure support. Also good news. :)
And also everything related to E-mode device (e.g. SeqNo sync for E-mode) could be left out for now. So only S-mode tool access SeqNo (sync service) handling would be ok for now if I understand it correctly.
from knx.
Important note:
The draft spec does NOT contain the most recent information concerning data secure.
- the SCF field has changed the bits slightly (slide no. 10, see below)
- the block B0 also contains the APCI directly after the TPCI instead 0x00.
Details see here in this presentation.
from knx.
Just some info.
The "Factory Default Setup Key" (FDSK) entered in ETS is just BASE32 encoded binary data which contains the KNX serial number and the 16 bytes of the toolkey (AES-128).
Example can be found here and here.
6 times 6 characters entered into the ETS lead to 36 chars where each char encodes 5 bit: 36*5=180Bit.
However:
(6bytes serial number +16 bytes toolkey) * 8 = 176 Bits.
What about the remaining 4 bit?
There also seems to be some simple checksum, when entering random characters, ETS will tell that the FDSK does not seem to be valid.
Last character (5bit) seems to contain the 4-bit checksum.
from knx.
Another finding:
The S-A_Sync-service does not work exactly as described in the draft spec.
See page 13 on these slides.
from knx.
Prerequite to support data secure:
Fix broadcast/systembroadcast#60Add function properties (PDT_FUNCTION)#63Add FunctionsPropertyExtCommand (0x1D4), FunctionPropertyExtStateRead (0x1D5), FunctionPropertyExtStateResponse (0x1D6)Add PropertyValueExtWriteCon, PropertyValueExtWriteUnCon, PropertyValueExtWriteConResponse, PropertyValueExtRead, PropertyValueExtReadResponse
from knx.
6 times 6 characters entered into the ETS lead to 36 chars where each char encodes 5 bit: 36*5=180Bit.
However:
(6bytes serial number +16 bytes toolkey) * 8 = 176 Bits.
What about the remaining 4 bit?
There also seems to be some simple checksum, when entering random characters, ETS will tell that the FDSK does not seem to be valid.
Last character (5bit) seems to contain the 4-bit checksum.
- Build octet stream 6 bytes serial number + 16 bytes toolkey
- calculate CRC-4 with polynom x^4+x+1 of the octet steam (176 bits = 22 bytes)
- Attach the CRC-4 checksum (4 bits) to this octet stream at the end
- calculate base32 representation of the octet stream to get the FDSK which is printed on the device.
- Optionally, generate QR code version 2 (25x25) with ECC error correction level M
from knx.
Is there nothing in the spec about this?
from knx.
It is, already implemented. 😀
https://github.com/thelsing/knx/pull/66/files#diff-00d45c6727ed3cf62043739242374959
from knx.
I think I have reached a state that should be merged.
My test setup:
- ETS 5.7.4
- hand-crafted knxprod with schema 20 (based on knx-demo). CreateKnxProd has to be modified: Empty "ReplaceVersions" cannot be parsed by ETS.
- bau57b0 (IP) code is used, but with a fake mask of 07b0 to simultate TP device connected over IP router.
- Assigning IA is working
- Programming application is working
- master reset is working
- Device starts to send out encrypted group communication (knx-linux demo code). For this the group address had to be set with enabled security.
- to get all this working, the following specifications had to be implemented (partly) too:
- AN163 “Extended Interface Object Addressing”
- AN177 “Extended Memory Services”
- ANxxx “Master Reset”
- missing, although mandatory:
- AN170 “Group Object Diagnostics”
- AN192 “Access Policies” (no plan to implement this from my side for DIY devices)
from knx.
Already merged.
from knx.
Related Issues (20)
- Device programming via ETS HOT 3
- getting error communicating with NCN HOT 1
- DPT 1.24 and 1.100 missing
- Transmitting Telegrams Over KNX Bus Error HOT 1
- cemi_frame.cpp
- big flash size though eeprom warning
- Issue on decoding DPT 10.001 values - "Index" HOT 3
- callbacks missing occasionally HOT 1
- Pass through KNX-bus to Serial with H8C09 board HOT 6
- Debug message since commit 338aa1b of 2023-05-28 maybe inconsistent ? HOT 8
- Update PlatformIO Registry Version and Example Projects HOT 2
- Arduino ethernet sheild supported?. HOT 1
- CI Pipeline broken HOT 1
- Basic documentation HOT 6
- Missing ARDUINO_ARCH_RP2040 in knx/bits.h HOT 7
- KNX-Demo no prog status in ETS HOT 1
- compiling doesn´t work HOT 5
- Via ETS: Programming the physical address only works very rarely. Mostly never. At some point, with luck, it works. HOT 4
- Compile error on knx_facade.h when importing library in third party PIO project HOT 2
- Stack stuck trying to load/unload application HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knx.