How to obfuscate windows long filenames without exceeding max length

46 views Asked by At

While backing up sensitive files between Windows 10 and SMB shares, I want to obfuscate the filenames. The source FS is NTFS and I don't want to change the filesystem on the source or the target. I've already found a very fast way to reversibly obfuscate the contents of the files.

I believe windows filenames are Unicode or UTF-16. A survey of the filenames shows they currently use about 400 different characters spread throughout the Unicode range but the solution must allow for any legal filename character.

Mapping the characters between two lists would require an array of ~150,000 possible values. Mathematically translating each character would risk falling on one of the famous list of characters not allowed in a filename, :/?<>\¦, etc. B64 encoding, in order to cover the Unicode range would double-ish the length of the filename.

Has anyone run into a known effective method for this or done this before?

I started off with a scheme to B64 encode the filenames using URL safe encoding but then realized a solid UTF-16 to Base 64 translation would vastly increase the length of the filenames.

0

There are 0 answers