Computer Science Canada [Tutorial] REBOL cloaking |
Author: | btiffin [ Sat Apr 12, 2008 3:46 am ] | ||||||||||||||||
Post subject: | [Tutorial] REBOL cloaking | ||||||||||||||||
REBOL cloak By Brian Tiffin April 2008 By the way ... the designer pronounces REBOL as rebel. cloaking REBOL, the Relative Expression Based Object Language comes bundled with encloak and decloak. This is not full strength encryption (available in commercial versions) such as AES or Blowfish hence the name encloak versus encrypt. The key is Secure Hash Algorithm 1, breached by crypography experts, but hard to crack nonetheless so don't forget your keys. Like many things in REBOL, cloaking is rather easy to use.
And here is a quick example.
Ok, that probably breaks a lot of web systems. Encloaked strings are not 7bit clean. Not good for email. Let's make that a little more forum friendly.
Not bad, but lets shrink it down some more. Base-64 makes for shorter binary encodings.
Now to try and see if all is well in scramble land.
Note the to string! step. You don't want to try and decloak the encoded binary! but the original scrambled string! data. Keep a file safe from prying eyes Here is a little script I use to keep rarely used passwords, and the Caramilk Secret.
This little script: looks for a command line argument, assumed to be a filename, or pops up a requestor. After making sure I want to overwrite any existing file I'm asked to type in my cloaking key. If I like the looks of the first 64 characters I typed my key properly and have the right file it will write a plain text version, call up the editor and then, after giving me one last chance, overwrite the plain text data with new scrambled information. Finally it destroys evidence of the key, not perfectly, from someone getting at my console. This being a personal tool, it is up to me to re-scramble the information if I didn't like the edit or something goes sideways. Don't give this code to your boss and then tell them that it is 100% reliable, rock solid code. It isn't. I keep the first line of my scrambled file with 64 characters of stuff I don't mind people walking by seeing. Before the edit it is up to me to make sure they have walked away before I answer Yes to the ok? prompt. This also requires a one time init of
I don't care if this is not 7bit clean, it's local and I don't mail it anywhere. It is solely for those times when I can't remember something that I should remember. I use it about every half hour. If I can't recall the cloaking key, I'm hosed. I'm not an encryption expert and have no idea how to break SHA1. I'd probably ask someone on compsci.ca for help. Or, gasp, RTFM. As always, for more information, please visit rebol.com. In case you don't know how they get the soft gooey caramel in a Caramilk bar. They take hard caramel, spit on it, and pour over the chocolate. By the time you get your candy bar the enzymes have softened the caramel. So, now you don't need to try and crack my scrambled file. Ok? Cheers |