This project decrypts a Wireless M-Bus telegram using AES-128-CBC as per OMS Volume 2 (Security Mode 5). It extracts metadata, constructs the IV, decrypts the payload, and outputs human-readable data.
- Meter Address: 8 bytes (ID + version + device type)
- Access Number (ACC): 1 byte, repeated 8 times in IV
- Encrypted Payload: AES-128 encrypted data
- CI Field: Indicates encryption (e.g., 0x8C)
- Extract meter address and access number
- Construct IV:
IV = meterAddress + (ACC Γ 8) - Decrypt using AES-128-CBC with provided key
- Validate: First two bytes should be
0x2F 0x2F - Parse TLV format for readings and status
sudo apt install libssl-dev g++
g++ main.cpp -o decrypt -lssl -lcrypto
./decrypt