Migration services: Difference between revisions

Line 849: Line 849:
Data specific to each message follows.
Data specific to each message follows.


Messages are encrypted with AES-128-GCM (excluding the [[#KeyExchange|KeyExchange]] messages). The key is derived during the messsage-handling for KeyExchange.
Messages are encrypted with AES-128-GCM (excluding the [[#KeyExchange|KeyExchange]] messages). The key is derived during the messsage-handling for KeyExchange. The 0xC-byte nonce is the 0x8-bytes derived by [[#KeyExchange|KeyExchange]], followed by a big-endian u32 counter (starting at 0x0). This counter is incremented each time a message is encrypted/decrypted.


The message size must match the expected fixed-size for the MessageId.
The message size must match the expected fixed-size for the MessageId.
Line 904: Line 904:
|}
|}


PBKDF2-HMAC-SHA256 is used with the first 0x28-bytes of the above plaintext as the passphrase, a 0x20-byte salt from fixed global data, iterations=1000, and i=1. The output is then used as the AES-128-GCM key for later messages.
PBKDF2-HMAC-SHA256 is used with the first 0x28-bytes of the above plaintext as the passphrase, a 0x20-byte salt from fixed global data, iterations=1000, and i=1. The first 0x10-bytes of the output HMAC then used as the AES-128-GCM key for later messages. The following 0x8-bytes is used as the first 0x8-bytes of the nonce.


= Notes =
= Notes =