How to Use the Licenseware Encryptor
Learn how to use the Licenseware Encryptor, a powerful PowerShell script designed to securely anonymize sensitive data in Excel and CSV files via SHA-256 hashing. The process generates protected ENCRYPTED_ files and a _KeyMap.csv, allowing you to share data confidently while maintaining its analytical integrity.
The Licenseware Encryptor is a powerful PowerShell script designed to help you anonymize sensitive data within your Excel (.xlsx) and CSV (.csv) files. It uses a one-way hashing method to obfuscate data in user-specified columns, ensuring that Personally Identifiable Information (PII) is protected while maintaining data relationships for analysis.
This tool is ideal for when you need to share data with Licenseware or other third parties for analysis without exposing sensitive information.
Overview
The Licenseware Encryptor uses a two-step workflow managed by a central catalog file. This allows you to easily control which data columns are obfuscated across all your files.
Step 1: Generate Catalog (-Mode GenerateCatalog)
First, you run the script in "Generate Catalog" mode. It scans all your files in the Input folder, finds every unique column header, and creates a master CSV file called Column_Catalog_To_Edit.csv.
Step 2: Obfuscate Data (-Mode Obfuscate)
After you edit the catalog to mark which columns to encrypt, you run the script in "Obfuscate" mode. It reads your choices from the catalog, asks for a secret key, and then processes all files, hashing the data in the specified columns. It creates a complete copy of every file and sheet in the Output folder, ensuring full data parity.
Before You Begin (Prerequisites)
To get started, you will need the following:
1. The Script File
Download your copy 👇
2. System Requirements
-
A Windows machine with PowerShell 5.1 or later. (This is standard on Windows 10 and 11).
3. Install the ImportExcel Module
The script relies on a trusted, third-party PowerShell module to handle Excel files. Before running the script for the first time, you must install this module.
-
Open PowerShell.
-
Copy and paste the following command and press Enter:
Install-Module -Name ImportExcel -Scope CurrentUser -Force
This is a one-time setup. You will not need to do this again on the same machine.
Step-by-Step Guide
Follow these steps to set up and run the Licenseware Encryptor.
Step 1: Create Your Folder Structure
-
Create a main folder for this process (e.g., C:\DataScrubber).
-
Save the Licenseware_Encryptor.ps1 script inside this main folder.
-
Inside the main folder, create a new subfolder and name it exactly Input.
-
Place all your Excel and CSV files into the Input folder.
Your folder structure should look like this:
C:\DataScrubber\
|
|--- Licenseware_Encryptor.ps1 (The script)
|
\--- Input\ (Your source files go here)
Step 2: Generate the Column Catalog
-
Open a PowerShell window.
-
Navigate to the main folder you created (e.g., cd C:\DataScrubber).
-
Run the following command to generate your master column list:
codePowershellpowershell.exe -ExecutionPolicy Bypass -File ".\Licenseware_Encryptor.ps1" -Mode GenerateCatalog
``` The script will scan all files and create a new file named **`Column_Catalog_To_Edit.csv`** in your main folder.
Step 3: Edit the Column Catalog
-
Open the Column_Catalog_To_Edit.csv file in Excel or any spreadsheet editor.
-
The file will have two columns: ColumnName and Encrypt.
-
For every row where you want the ColumnName to be obfuscated, enter yes (or y, encrypt, obfuscate) into the Encrypt column.
-
Leave the Encrypt column blank for any headers you want to keep raw.
-
Save and close the file.
Example Column_Catalog_To_Edit.csv:
| ColumnName | Encrypt |
| Department | |
| Email Address | yes |
| Employee Name | y |
| Hire Date | |
| User Name | encrypt |
Step 4: Run the Obfuscation Process
-
Return to your PowerShell window, which should still be in the correct directory.
-
Run the script in its Obfuscate mode:
codePowershellpowershell.exe -ExecutionPolicy Bypass -File ".\Licenseware_Encryptor.ps1" -Mode ObfuscateStep 4: Enter Your Secret Key (Salt)
Step 5: Enter Your Secret Key (Salt)
The script will now prompt you to enter your secret key.
#.png?width=580&height=207&name=image%20(1).png)
The script will now display the Licenseware Encryptor banner and prompt you to enter your secret key.
⚠️ Important: This key is critical. It is used as a "salt" for the hashing process.
-
The key must be 8-20 characters long.
-
It must be alphanumeric (letters and numbers only). No special characters or spaces.
-
You must remember this key. If you need to obfuscate more files in the future and want the values to match, you will need to use the exact same key. Losing this key means the _KeyMap.csv is the only way to identify the original data.
Step 6: Review the Output
The script will process your files and automatically create an Output folder. Inside, you will find:
-
ENCRYPTED_ files: Your original files, now with the specified data obfuscated and the (encrypt) tags removed from the headers.
-
_KeyMap.csv: A two-column file containing the OriginalValue and its corresponding ObfuscatedValue. This is your lookup key. Guard it carefully.
Troubleshooting
"File cannot be loaded... not digitally signed" Error
This is the most common issue and is caused by PowerShell's security policies. If the Bypass command in Step 3 fails, you can set the policy for your user account with these one-time steps:
-
Click the Start Menu and type "PowerShell".
-
Right-click "Windows PowerShell" and select "Run as administrator".
-
In the admin window, run this command:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
It may ask for confirmation. Type Y and press Enter.
-
Close the administrator window. You can now run the script from a normal PowerShell window using just .\Obfuscate-Data.ps1.
How It Works (Technical Details)
-
Hashing Algorithm: The script uses SHA-256, a one-way cryptographic hash function. This is an industry standard for creating a unique and irreversible "fingerprint" of data.
-
Salting: Your secret key is used as a salt. This means it is added to your data before hashing. This technique protects the obfuscated data against dictionary and rainbow table attacks, making it significantly more secure.
Getting Support
If you encounter any issues or have questions about the Licenseware Encryptor, please don't hesitate to reach out.
-
Email: support@licenseware.io
-
Help Center: https://help.licenseware.io