I just published a new version of my open source C# Zoro library in Github and Nuget.org.
Zoro is a data anonymization (also called “masking”) utility. It fetches data from databases and files, anonymizes them according to the configuration provided and uses the anonymized data to create a new file or create/modify database data (using INSERTs, UPDATEs etc).
In the new version, 3.0, the library is still based on DotNet Standard 2.1, which offers the widest possible compatibility. The command line utility and the test project have been upgraded to DotNet 10.
But the most important new feature is that, apart from structured data data such as CSVs and JSONs, Zoro now starts supporting semi-structured data in the form of Office documents. Version 3.0.0 starts with document (.docx) support. Spreadsheets (.xlsx) and presentations (.pptx) are coming soon!
For example, let’s say you want to anonymize IBANs is such a document:
In order to anonymize the above data, your config could look like this:
<?xml version="1.0"?>
<MaskConfig xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<FieldMasks>
<FieldMask>
<FieldName>IBAN</FieldName>
<MaskType>List</MaskType>
<RegExMatch>\b([A-Z]{2}[0-9]{2}(?:[ ]?[A-Z0-9]{4}){2,7}(?:[ ]?[A-Z0-9]{1,4})?)\b</RegExMatch>
<RegExGroupToReplace>1</RegExGroupToReplace>
<ListOfPossibleReplacements>
<Replacement Selector="" List="NL11 1111 1111 1111 11,GR22 2222 2222 2222 22,CH33 3333 3333 3333 33" />
</ListOfPossibleReplacements>
</FieldMask>
</FieldMasks>
<InputFile>C:\temp\Zorotests\report.docx</InputFile>
<OutputFile>C:\temp\Zorotests\report_masked.docx</OutputFile>
<DataSource>DocXFile</DataSource>
<DataDestination>DocXFile</DataDestination>
</MaskConfig>
This will replace all IBANs (CH09 0000 0000 1234 5678 9, DE89 1234 5678 9012 3456 78 etc) with one of NL11 1111 1111 1111 11, GR22 2222 2222 2222 22 or CH33 3333 3333 3333 33.
If you have any questions, happy to reply, please write in the comments 😊
Enjoy!
