Map<String, Object?> toJson() { final data = <String, Object?>{}; data['algorithm'] = algorithm; data['salt'] = salt; data['iterations'] = iterations; if (bits != null) data['bits'] = bits; return data; }