Skip to content

Attribute-driven data anonymization library for C# development and testing.

License

Notifications You must be signed in to change notification settings

tulior/schema-shroud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SchemaShroud C# Data Anonymizer

MIT License

Secure Data Obfuscation for .NET Applications

SchemaShroud provides targeted data anonymization for C# objects through declarative attributes. Designed for developers handling sensitive information in non-production environments.

Core Features

  • Attribute-based field marking
  • Four anonymization strategies
  • Recursive object processing
  • Custom strategy support

Installation

  1. Clone repository
  2. Include these files in your project:
    • DataAnonymizer.cs
    • SensitiveDataAttribute.cs
    • AnonymizationStrategies/**

Usage

  1. Annotate model properties:
public class CustomerRecord
{
    [SensitiveData(AnonymizationMethod.Hash)]
    public string Email { get; set; }

    [SensitiveData(AnonymizationMethod.Mask)]
    public string PaymentCard { get; set; }

    [SensitiveData(AnonymizationMethod.Range, Interval = 1000)]
    public int Salary { get; set; }
}
  1. Process objects:
var processor = new DataAnonymizer();
var cleanData = processor.Anonymize(rawData);

Anonymization Methods

Method Behavior Example
Hash SHA256 conversion "[email protected]" → hex
Redact Fixed replacement ("***") "John Doe" → "***"
Mask Last 4 visible, others starred "4111111111111111" → "************1111"
Range Rounds to nearest interval 1234 → 1000 (interval=1000)

Customization

Extend strategies by implementing IAnonymizationStrategy:

public class NoiseStrategy : IAnonymizationStrategy
{
    public object Anonymize(object value)
    {
        return (int)value + new Random().Next(-100, 100);
    }
}

// Configure:
var strategies = new Dictionary<AnonymizationMethod, IAnonymizationStrategy>
{
    { AnonymizationMethod.Range, new NoiseStrategy() }
};
var processor = new DataAnonymizer(strategies);

Requirements

  • .NET Standard 2.0+
  • No external dependencies

Limitations

  • Requires mutable properties
  • Primarily handles string/numeric types
  • No built-in collection support

Contributing

Issue reports and pull requests welcome. Maintain test coverage when submitting changes.

License

MIT - see LICENSE file

About

Attribute-driven data anonymization library for C# development and testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages