Encrypt Password - Decrypt same

Dar Scott dsc at swcp.com
Mon Nov 29 15:56:10 EST 2004


On Nov 29, 2004, at 1:36 PM, Steve Bonham wrote:

> on closestack
> 	open file "settings.txt"
>  	encrypt fld "password" using "bf-cbc" with "Danger, Will Robinson."
> 	write it to file "settings.txt"
> 	close file "settings.txt"
> end closestack

Yeah, but the encrypted data is binary, so try this...

on closestack
    encrypt fld "password" using "bf-cbc" with "Danger, Will Robinson."
    put it into URL "binfile:settings.bin"
end closestack

Or use base64encode() if you need to have a text file.

Now you need to make sure no one will see your secret phrase "Danger, 
Will Robinson."

> This would result in "Jedi2004" appearing in fld "password" again?

Yes, once you resolve the binary issue.

> -- and I can use any value for the pass_phrase so I could replace 
> "Danger, Will Robinson." with "Luke, Trust the force!" right?

Right.

This can be a confusing example to some folks, in that you are 
encrypting something you call a password.  This will work with any 
data.

Of course you have to address the problem of what to do when there is 
no settings file and what to do about folks copying settings files 
(which might be nothing).

Dar

****************************************
     Dar Scott Consulting
     http://www.swcp.com/dsc/
     Programming Services
****************************************



More information about the use-livecode mailing list