lightning-dev

[PATCH v3] daemon: encrypted communication (version 3)

[PATCH v3] daemon: encrypted communication (version 3)

Original Postby Pierre

Posted on: October 27, 2015 17:00 UTC

In this context, the author discusses two main points related to encryption.

Firstly, they explain that ECDH is used to derive a shared secret which is then used to generate various transmission encoding parameters such as Session AES-128 key, Session HMAC key and IV for AES. They also mention that only the first 16 bytes are used for aes_key and aes_iv. Secondly, the author talks about packet encryption and mentions that all packets are encrypted using HMAC and contains totlen and data. However, the author raises concerns regarding the comment in the code where totlen represents the size of the unencrypted serialized protobuf message rather than the total data transmitted. The author also questions why totlen includes the length of itself since it doesn't define the encrypted message boundaries anyway. Additionally, they inquire why the length is encoded on 64 bits instead of 32 bits.