Serialize to JSON.
Map<String, dynamic> toJson() { return { 'id': id, 'key': _hex(key), 'salt': salt, }; }