![]() |
VOOZH | about |
dotnet add package Walter.Cypher.Newtonsoft.Json --version 2025.9.1440
NuGet\Install-Package Walter.Cypher.Newtonsoft.Json -Version 2025.9.1440
<PackageReference Include="Walter.Cypher.Newtonsoft.Json" Version="2025.9.1440" />
<PackageVersion Include="Walter.Cypher.Newtonsoft.Json" Version="2025.9.1440" />Directory.Packages.props
<PackageReference Include="Walter.Cypher.Newtonsoft.Json" />Project file
paket add Walter.Cypher.Newtonsoft.Json --version 2025.9.1440
#r "nuget: Walter.Cypher.Newtonsoft.Json, 2025.9.1440"
#:package Walter.Cypher.Newtonsoft.Json@2025.9.1440
#addin nuget:?package=Walter.Cypher.Newtonsoft.Json&version=2025.9.1440Install as a Cake Addin
#tool nuget:?package=Walter.Cypher.Newtonsoft.Json&version=2025.9.1440Install as a Cake Tool
Introducing the WALTER Framework: Workable Algorithms for Location-aware Transmission, Encryption Response. Designed for modern developers, WALTER is a groundbreaking suite of NuGet packages crafted for excellence in .NET Standard 2.0, 2.1, Core 3.1, and .NET 6, 7, 8, as well as C++ environments. Emphasizing 100% AoT support and reflection-free operations, this framework is the epitome of performance and stability.
Whether you're tackling networking, encryption, or secure communication, WALTER offers unparalleled efficiency and precision in processing, making it an essential tool for developers who prioritize speed and memory management in their applications.
The Walter.Cypher.Newtonsoft.Json NuGet package provides a set of custom converters designed to enhance the security and privacy of your .NET applications by protecting sensitive data, especially useful in adhering to GDPR requirements. These converters can be easily integrated with the Newtonsoft.Json serialization and deserialization process, obfuscating sensitive information such as IP addresses, strings, dates, and numbers.
You can visit the static html help file at https://walter_cypher_newtonsoft_json.asp-waf.com as well as visit our Github samples at https://github.com/vesnx/Walter.Cypher.Newtonsoft.Json
To use this package, first install it via NuGet
Install-Package Walter.Cypher.Newtonsoft.Json
The native package is not compatible with the android symulator so if you are not using the package to accept data from or send data to a android simulator set
Walter.Native.Wrapper.SymmetricEncryption.ArmSimulatorCompatible = false
This example demonstrates configuring System.Newtonsoft.Json to use the provided GDPR converters for both serialization and deserialization processes, ensuring that sensitive data is adequately protected according to GDPR guidelines.
You can then use these converters in a class or record, the bellow sample uses a combination of property names and converters to remove any inferable information from the Json string
using Newtonsoft.Json;
[JsonObject( MemberSerialization.OptIn)]
record ProfileData
{
[JsonConstructor]
internal ProfileData(List<IPAddress> a, string b, IPAddress c, int d)
{
AddressRange = a;
SecretText = b;
SingleAddress = c;
CCV = d;
//use Walter NuGet package to inverse inject ILogger
//if no logger injected a default target will be used
//depending the OS different targets are used, in windows
//this is the Application event log
Inverse.GetLogger("ProfileData")?.LogInformation("Json constructor called");
}
[JsonProperty("a")]
[JsonConverter(typeof(GDPRIPAddressListConverter))]
public List<IPAddress> AddressRange { get; }
[JsonProperty("b")]
[JsonConverter(typeof(GDPRObfuscatedStringConverter))]
public string SecretText { get; }
[JsonProperty("c")]
[JsonConverter(typeof(GDPRIPAddressConverter))]
public IPAddress SingleAddress { get; }
[JsonProperty("d")]
[JsonConverter(typeof(GDPRObfuscatedIntConverter))]
public int CCV { get; }
}
Optionally you can use dependency injection to integrate the Walter framework and use a shared secret password for the json encryption
//secure the json using a protected password
using var service = new ServiceCollection()
.AddLogging(option =>
{
//configure your logging as you would normally do
option.AddConsole();
option.SetMinimumLevel(LogLevel.Information);
})
//set the application password for json encryption
.UseSymmetricEncryption("May$ecr!tPa$$w0rd")
.BuildServiceProvider();
service.AddLoggingForWalter();//enable logging for the Walter framework classes
No specific configuration is need as we have defined the converter attributes on the properties.
//set the options you need. in this sample we us a internal constructor
JsonSerializerSettings _options = new JsonSerializerSettings()
{
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
};
/*
save to json and store or send to a insecure location the profile to disk.
note that data in transit can be read even if TLS secured using proxy or man in the middle.
*/
var profile = new UserProfile() {
Email = "My@email.com",
Name = "Jo Coder",
DateOfBirth = new DateTime(2001, 7, 16),
Devices=[IPAddress.Parse("192.168.1.1"),IPAddress.Parse("192.168.1.14"), IPAddress.Loopback]
};
var json= JsonConvert.SerializeObject(profile, _options);
var directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MySupperApp");
var fileName = Path.Combine(directory, "Data1.json");
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
//use inversion of control and generate a ILogger without dependency injection
Inverse.GetLogger("MyConsoleApp")?.LogInformation("Cyphered json:\n{json}", json);
await File.WriteAllTextAsync(fileName, json).ConfigureAwait(false);
Read the encrypted JSON from storage or after transmission, and deserialize it back into the UserProfile class, automatically decrypting and validating the data.
var cypheredJson = await File.ReadAllTextAsync("path_to_encrypted_json").ConfigureAwait(false);
//use the string extension from the Walter NuGet package to try and serialize the object
if (cypheredJson.IsValidJson<UserProfile>(_options,out var user))
{
// Use the deserialized and decrypted `user` object
}
The following is a working example of how you could use this in a console application
internal record UserProfile
{
[JsonProperty("a")]
[JsonConverter(typeof(GDPRObfuscatedStringConverter))]
public required string Name { get; set; }
[JsonProperty("b")]
[JsonConverter(typeof(GDPRObfuscatedStringConverter))]
public required string Email { get; set; }
[JsonProperty("c")]
[JsonConverter(typeof(GDPRObfuscatedDateTimeConverter))]
public DateTime DateOfBirth { get; set; }
[JsonProperty("d")]
[JsonConverter(typeof(GDPRIPAddressListConverter))]
public List<IPAddress> Devices { get; set; } = [];
}
//secure the json using a protected password
using var service = new ServiceCollection()
.AddLogging(option =>
{
//configure your logging as you would normally do
option.AddConsole();
option.SetMinimumLevel(LogLevel.Information);
})
.UseSymmetricEncryption("May$ecr!tPa$$w0rd")
.BuildServiceProvider();
service.AddLoggingForWalter();//enable logging for the Walter framework classes
JsonSerializerSettings options = new JsonSerializerSettings()
{
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
};
//... rest of your code
/*
save to json and store or send to a insecure location the profile to disk.
Data in transit can be read even if TLS secured using proxy or man in the middle.
*/
var profile = new UserProfile()
{
Email = "My@email.com",
Name = "Jo Coder",
DateOfBirth = new DateTime(2001, 7, 16),
Devices = [IPAddress.Parse("192.168.1.1"), IPAddress.Parse("192.168.1.14"), IPAddress.Loopback]
};
var json = JsonConvert.SerializeObject(profile, options);
var fileName = Path.GetTempFileName();
//use inversion of control and generate a ILogger without dependency injection
Inverse.GetLogger("MyConsoleApp")?.LogInformation("Cyphered json:\n{json}", json);
await File.WriteAllTextAsync(fileName, json).ConfigureAwait(false);
//... rest of your code
/*
Read the json back in to a class using this simple extension method
*/
var cypheredJson = await File.ReadAllTextAsync(fileName).ConfigureAwait(false);
//use string extension method from Walter NuGet package to generate json from a string
if (cypheredJson.IsValidJson<UserProfile>(options, out UserProfile? user))
{
//... user is not null and holds decrypted values as the console will show
Inverse.GetLogger("MyConsoleApp")?.LogInformation("Profile:\n{profile}", user.ToString());
}
if (File.Exists(fileName))
{
File.Delete(fileName);
}
In the example provided earlier, we showcased the serialization of a UserProfile object into a JSON format using advanced encryption techniques. This approach ensures that sensitive information within the UserProfile is securely obfuscated, requiring SHA-256 (or stronger) decryption capabilities for access. The JSON output is fully encrypted, making it a robust solution for protecting personal data, especially when adhering to GDPR standards or when data security is paramount.
Below is an example of how the UserProfile data appears after encryption and serialization into JSON. Note that each field are represented by a key (e.g., "a", "b", "c", "d"), and their values are encrypted strings. This encryption not only protects the data during transit or storage but also ensures that any identifiable information is not directly exposed in the serialized format.
{"a":"MyXKKzy8oKLeS1at6f5r7Ew1ZhL/9XpQFbQih6qC6fs=","b":"/XmXqpoYWyh9P/dimhCI46rAjCYQLdGdDJEoJLB9nnk=","c":"/LMLvcDRsS/WyuPw6yvFy67+jLsGsFWH07IxfFk1A7sKlQmgtZZQQF7E9743wxa2","d":["3CSNib1uly38gqAa15P+bRpl2aLG4HKf8D29OUEr3SI=","GSnPjkfS8zkSgmfOVT680dXf+fOWZR4pehyPOB0OnuM=","ryhts2Fn9jC0FUCfyRNVMp6ChNpa3t3jzojxpXLt0/o="]}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.9.1440 | 184 | 9/28/2025 |
| 2025.8.13.1215 | 217 | 8/13/2025 |
| 2025.7.10.1343 | 209 | 7/10/2025 |
| 2025.6.30.2102 | 224 | 7/1/2025 |
| 2025.6.12.1057 | 370 | 6/12/2025 |
| 2025.4.17.1600 | 255 | 4/17/2025 |
| 2025.3.13.1306 | 229 | 3/13/2025 |
| 2025.2.26.1548 | 184 | 2/26/2025 |
| 2025.2.15.1301 | 202 | 2/15/2025 |
| 2025.1.16.1405 | 196 | 1/16/2025 |
| 2024.11.30.1709 | 195 | 12/13/2024 |
| 2024.11.28.1622 | 172 | 11/28/2024 |
| 2024.11.20.1316 | 190 | 11/21/2024 |
| 2024.11.14.1710 | 201 | 11/14/2024 |
| 2024.11.6.1222 | 213 | 11/6/2024 |
| 2024.10.28.1605 | 203 | 10/28/2024 |
| 2024.10.28.1335 | 175 | 10/28/2024 |
| 2024.10.19.1525 | 203 | 10/20/2024 |
12 June 2025
-Update to .net 9.04 and .net 8.0.3
12 Mar 2025
-Update NuGet dependencies that have vulnerabilities
26 Feb 2025
- Update package references
2 April 2024
- Update to 8.0.3