Mask.BlurX 1.0.2

dotnet add package Mask.BlurX --version 1.0.2
                    
NuGet\Install-Package Mask.BlurX -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mask.BlurX" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mask.BlurX" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Mask.BlurX" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mask.BlurX --version 1.0.2
                    
#r "nuget: Mask.BlurX, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mask.BlurX@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mask.BlurX&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Mask.BlurX&version=1.0.2
                    
Install as a Cake Tool

BlurX

BlurX is a lightweight, enterprise-grade data masking library for .NET that helps you protect sensitive information (PII, credentials, emails, phone numbers, card numbers, etc.) directly at the model/DTO property level using simple attributes.

Built for:

  • ✅ Zero-effort field masking\
  • ✅ Fine-grained, per-property control\
  • ✅ Multiple ready-to-use masking styles\
  • ✅ High-performance reflection engine\
  • ✅ Enterprise-ready customizability

✨ Features

  • Apply masking using simple attributes\
  • Control visible character count, mask length, and mask character\
  • Supports multiple masking strategies:
    • Prefix masking
    • Suffix masking
    • Middle masking
    • Full masking
    • Email masking
    • Regex-based masking
  • Handles:
    • Single objects\
    • Lists & collections\
  • Easy extensibility for custom masking rules

📦 Installation

Install via NuGet:

dotnet add package Mask.BlurX

Or using the NuGet Package Manager:

Install-Package Mask.BlurX

🚀 Quick Example

Model Example

public class UserInfo
{
    [BlurXField(BlurStyle.Email)]
    public string Email { get; set; }

    [BlurXField(BlurStyle.Regex, regexPattern: @"\d")]
    public string UserName { get; set; }

    [BlurXField(BlurStyle.Prefix)]
    public string WorkPhone { get; set; }

    [BlurXField(BlurStyle.Prefix, visibleCharCount: 1)]
    public string Phone { get; set; }
        
    [BlurXField(BlurStyle.Suffix, visibleCharCount: 1)]
    public string Phone2 { get; set; }

    [BlurXField(BlurStyle.Default)]
    public string Phone3 { get; set; }

    [BlurXField(BlurStyle.Full)]
    public string Password { get; set; }

    [BlurXField(BlurStyle.Middle, maskChar: '#', maskLength: 6)]
    public string CardNumber { get; set; }
}

Masking Usage

var user = new UserInfo
{
    Email = "john.doe@example.com",
    UserName = "john007.doe",
    Phone = "9876543210",
    WorkPhone = "9876543210",
    Phone2 = "9876543210",
    Phone3 = "9876543210",
    Password = "MyStrongPassword123",
    CardNumber = "4111 1111 1111 1111",
};

var masked = BlurX.Mask(user);

Output

    {
      "Email": "********@example.com",
      "UserName": "john***.doe",
      "WorkPhone": "******3210",
      "Phone": "9******210",
      "Phone2": "987******0",
      "Phone3": "98******10",
      "Password": "*******************",
      "CardNumber": "4111 1######11 1111"
    }

🛠️ Configuration Options

Each property allows full control using the attribute:

[BlurX(
    Style = BlurStyle.Middle,
    MaskChar = '*',
    MaskLength = 4,
    VisibleCharCount = 2,
    RegexPattern = null
)]
public string CardNumber { get; set; }

Parameter Description


Style Defines how masking is applied (Prefix/Suffix/Middle/Full/Email/Regex)

MaskLength Number of characters to replace with mask character

VisibleCharCount Number of characters to keep unmasked

MaskChar Character used for masking (default: *)

RegexPattern Custom masking via regular expression


📂 Supports Complex Scenarios

  • Mask entire objects\
  • Mask deeply nested properties\
  • Mask dynamic collections\
  • Use custom masking engines

📞 Contact & Support

If you find a bug, need an enhancement, or want to suggest a new feature:


🤝 Contributing

Contributions are welcome!
Feel free to submit:

  • Pull Requests\
  • Feature Requests\
  • Bug Reports

❤️ Support the Project

If this package helps you, please give it a ⭐ on GitHub and leave a review on NuGet.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 452 12/11/2025
1.0.1 448 12/10/2025

Please report bugs or issues here:
https://github.com/vimalkatariya/BlurX/issues