struct
#include <include/mtx/responses/crypto.hpp>
EncryptedSessionData Encrypted session data using the m.megolm_backup.v1.curve25519-aes-sha2 algorithm.
Public variables
- std::string ephemeral
- Generate an ephemeral curve25519 key, and perform an ECDH with the ephemeral key and the backup's public key to generate a shared secret. The public half of the ephemeral key, encoded using unpadded base64, becomes the ephemeral property.
- std::string ciphertext
- Stringify the JSON object, and encrypt it using AES-CBC-256 with PKCS#7 padding. This encrypted data, encoded using unpadded base64, becomes the ciphertext property of the session_data.
- std::string mac
- Pass the raw encrypted data (prior to base64 encoding) through HMAC-SHA-256 using the MAC key generated above. The first 8 bytes of the resulting MAC are base64-encoded, and become the mac property of the session_data.