Skip to content
Sign in

Hash columns with the Licenseware Encryptor

The Licenseware Encryptor is a PowerShell script, Licenseware_Encryptor.ps1. It hashes the columns you choose in Excel and CSV files, so the same original value always becomes the same hashed value, and writes a keymap so you can look the originals up later.

You run it on Windows, on the files, before you upload them. Use it when you need to share data with Licenseware or another party without exposing the sensitive values. Encrypt each data source in its own run. Do not mix two sources in one Input folder.

  • Windows with PowerShell 5.1 or later.
  • The script file Licenseware_Encryptor.ps1.
  • The ImportExcel module, once per machine. In PowerShell:
Terminal window
Install-Module -Name ImportExcel -Scope CurrentUser -Force
  1. Create a folder for the job, for example C:\DataScrubber.
  2. Save Licenseware_Encryptor.ps1 in that folder.
  3. Create a subfolder named Input.
  4. Put the Excel and CSV files in Input.

Generate a catalog of every column header in those files:

Terminal window
powershell.exe -ExecutionPolicy Bypass -File ".\Licenseware_Encryptor.ps1" -Mode GenerateCatalog

That writes Column_Catalog_To_Edit.csv in the main folder, with ColumnName and Encrypt. For each column you want hashed, put yes in Encrypt. y, encrypt, and obfuscate also work. Leave Encrypt blank to keep the column as it is. Save the file.

Terminal window
powershell.exe -ExecutionPolicy Bypass -File ".\Licenseware_Encryptor.ps1" -Mode Obfuscate

The script asks for a secret key.

The Licenseware Encryptor prompt, asking for a secret key of 8 to 20 letters and numbers

  • 8 to 20 characters.
  • Letters and numbers only.
  • Use the same key when you hash more files and you need the values to match. The keymap is the lookup if you do not have the key.

The script creates an Output folder:

FileWhat it is
ENCRYPTED_ filesCopies of your files, with the marked columns hashed.
_KeyMap.csvOriginalValue and ObfuscatedValue. Keep this. It is how you identify the original values.

The script uses SHA-256. The key is the salt mixed in before the hash.

File Explorer in the Encryptor processed-files folder, with the original workbooks beside the folder of encrypted copies. File names are blurred.

The encrypted folder, with the hashed copies of the workbooks

If you see “File cannot be loaded… not digitally signed”, open PowerShell as administrator and run:

Terminal window
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Confirm with Y, close that window, and run the script again from a normal PowerShell window.

Upload the ENCRYPTED_ files as you would any other file. Questions about the script: support@licenseware.io.