Introduction
Files somehow related to me can be found on my PCs, but also on all the
other boxes around the house, including the NAS server, which is now seen
regularly by visitors using my WiFi, etc. I may also leave files on random PCs
I work on and may want to leave some notes on them that only I need to look at.
I also tend to use very descriptive dir and file names, often leaving them
without contents!
A directory named "! 2012 My new novel (inspired by my inlaws)" will attract attention,
but "! 2012 Zl arj abiry (vafcverq ol zl vaynjf)" will not. A file named
"Summer 2011 secret diary.doc" looks less tempting if renamed to "Fhzzre 2011 frperg qvnel.qbp".
(Note that this encryption algorithm only changes letters; all other characters remain intact).
Other likely candidates are: documents, movies, funny clips and PowerPoint
presentations mailed to you that you just can't delete, your "secret projects",
and any other stuff you want to keep relatively private in your environment.
If "busted", there would be no major consequences upon your life and career :-).
However, if you need serious data protection, this toy is not for you.
Implementation
Some text editors have the ROT13 encode/decode built-in, so there is absolutely
no security in using DAFNO. It's just a small inconvenience for a determined
snooper, but a major wall to climb for practically everybody around you.
The beauty is that DAFNO fits in so well into ZTree that it feels like a native function.
It uses the F12 macro function to execute the following macro. The macro
calls an external program that generates the obfuscated name, and then
ZTree's Rename function renames the currently selected dir of file:
I often need to temporarily hide directories or files at home or work, for
whatever reason. The idea is not to securely encrypt the contents, but only make the
names appear as random gibberish to casual users so that they simply
ignore them, the way we ignore temporary files with meaningless names.
I chose the simplest possible "encryption" -- ROT13 --
which is still annoying even to hackers to "crack", since they must have a tool at
hand and apply it to every single renamed object.
Rename_ROT13++.ZTM |
---|
; Rename_ROT13++.ZTM -- Encode current object in ROT13 and advance ; Usage: Use F12 and optional F4 repeat counter to execute this lots of times ; ; Copy current dir/file to cliboard CTRL_INS,N ; Call ROT13CLP.EXE (compiled AHK) to encode clipboard contents in ROT13 x,C:\1\ROT13CLP.EXE,RET ; NOTE: The RET above will work if you have Configuration Option 3R set as: ; R eXecute - Closes window after executing Yes ; If not, you must add an ESC after RET to close the eXecute window explicitly ; Rename file with clipboard contents r,SH_INS,RET ; Move selector down to next object DOWN,STOP |
ROT13CLP.EXE
ROT13CLP.EXE is the external program that does the ROT13 conversion
of each character in the dir or file name and gives it back to ZTree.
The public source code, compiled in AutoHotkey, is shown below. However, it is
trivial to plug in any other renamer (or a full-blown contents encrypter!)
into ZTree by supplying some other executable.
ROT13CLP.AHK |
---|
; ROT13CLP.AHK - Convert clipboard to ROT13 (simple encoding) ; http://www.autohotkey.com/community/viewtopic.php?t=8421 ; DEL C:\1\ROT13CLP.exe ; C:\1\AHK\Compiler\Ahk2Exe.exe /in C:\1\ROT13CLP.AHK /out C:\1\ROT13CLP.exe ClipBoard := Rot13(ClipBoard) Rot13(string) { Loop Parse, string { char := Asc(A_LoopField) ; o is 'A' code if it is an uppercase letter, and 'a' code if it is a lowercase letter o := 65*(64<char && char<91)+97*(96<char && char<123) ;o := Asc("A") * (Asc("A") <= char && char <= Asc("Z")) + Asc("a") * (Asc("a") <= char && char <= Asc("z")) If (o > 0) { ; Set between 0 and 25, add rotation factor, modulus alphabet size char := Mod(char - o + 13, 26) char := Chr(char + o) ; Transform back to char, upper or lower } Else { char := A_LoopField ; Non alphabetic, unchanged } rStr .= char } Return rStr } |
Going native?
If this toy gets any attention in the ZTree community, it could be a simple and natural
addition to Rename. Native code would eliminate the huge overhead caused by executing
an external program, not to mention making use of tagging! Also, a more secure
algorithm could be used, possibly using the local ZTW.KEY file as part of the key.
Disclaimer
The DAFNO components are free for anybody to use and modify at their own risk.
DAFNO is being used daily with the lastest versions of ZTree on Windows XP/SP3.
No tests were done on other platforms.