EDI File Scrubber

Hide Sensitive Data In EDI Documents

EDIFileScrubber provides a simple, high-speed way to mask and protect sensitive data within your EDI documents. It allows you to quickly redact or sanitize private fields, ensuring complete data privacy and security compliance before files are shared or used in testing environments.

 

Main Features

Details

Protecting privacy should not require an EDI degree. Whether you need to mask patient names, addresses, SSNs, or corporate IDs, EDIFileScrubber handles the sanitization seamlessly. It gives developers the power to mask confidential data instantly without needing to study or understand the complex X12 structural standard.

For example, let’s take a simple ISA segment

ISA*00*          *00*          *ZZ*ASHTB          *ZZ*01017          *040315*1005*U*00401*004075123*0*P*:~

After processing the EDI file any element could be masked using the EDI File Scrubber.  For example:

ISA*QQ*QQQQQQQQQQ*QQ*QQQQQQQQQQ*ZZ*ASHTB          *ZZ*01017          *040315*1005*U*00401*004075123*0*P*:~

As shown below we have just masked element 1,2,3 and 4 by replacing their values with the letter ‘Q’.  Notice that the lengths of the elements remain the same.  Developers can configure any element or composite element value to be masked.

Scrubbing from a File or In-Memory String

EDIFileScrubber can scrub files from the file system using the EDIFile property or from a string of EDI data using the EDIDataString property.

Auto Detection of Delimiters

EDIFileScrubber has a Delimiter property that can be set if these delimiters are known beforehand.  It also has a property called AutoDetectDelimiters.  By enabling this property EDIFileScrubber detects the special delimiter characters while scrubbing is being performed.

Accessing Scrubbed Data

EDIFileScrubber bypasses heavy validation rules and schema hierarchies to deliver maximum scrubbing speeds. Instead of loading your file into a complex structure, it reads every segment into a single, flat loop. This lean, rule-free approach eliminates strict format constraints—giving you the ultimate flexibility to quickly sanitize and consume raw text data exactly how you want.

The Code

// Create a new instance of EDIFileScrubber
EDIFileScrubber scrubber = new EDIFileScrubber

// Set the EDI file path to scrub
scrubber.EDIFile = "C:\\EDIFile.txt

// Set the scrubbing rule (s)

// Set element 0,1,2,3 of the ISA segment to be replaced by the character 'Q'
ScrubRule rule = new ScrubRule();
rule.SegmentName = "ISA";
rule.ReplaceCharacter = 'Q';
rule.ScrubPositions.Add(new ScrubPosition(0));
rule.ScrubPositions.Add(new ScrubPosition(1));
rule.ScrubPositions.Add(new ScrubPosition(2));
rule.ScrubPositions.Add(new ScrubPosition(3));

// Set composite element 0 element 0 of the SVC segment to be replaced by the character 'W' 
ScrubRule rule2 = new ScrubRule();
rule2.SegmentName = "SVC";
rule2.ReplaceCharacter = 'W';
rule2.ScrubPositions.Add(new ScrubPosition(0,0));

scrubber.ScrubRules.Add(rule);
scrubber.ScrubRules.Add(rule2);

// scrub the data
EDILightWeightDocument doc = scrubber.Scrub();