> Why are strings encrypted? I "vaguely" understand the concept, but the 
> expression is bandied about so freely that I figure someone must know 
> something that I don't know. Unless it serves a purpose beyond what I think 
> it does, it seems to me to just overly complicate things that are already 
> pretty complicated. I don't like the thought of dealing with more levels of 
> complication than is absolutely necessary. Of course, I can be pretty naive 
> about some things! (smile) Also, I'm honest and I understand that much of the 
> world is not.

Bottom line is that it gives you a way to get an encrypted string instead of 
providing your own encryption/decryption functions.

If you have your own encrypt/decrypt functions you like to use, you don't need 
to have 'ask password' encrypt it for you. And actually, as was recently 
mentioned, there's an "mcEncrypt" function that you can run separately to give 
you the same thing "ask password" gives you automatically. This is useful if 
you want to add something you want to store with the password, but use the same 
encryption:

Compare:

ask password "Password:"
put it into tEncryptedString

(later)
ask password "Password:"
if it = tEncryptedString then
   -- let 'em in
else
   -- wrong password
   -- don't let 'em in
end if

VERSUS:

ask password clear "Password:"
put it into tUnencryptedString
put "Ken Ray" into tUserName
put mcEncrypt(tUserName & cr & tUnencryptedString) into tEncryptedString

(later)
ask password clear "Password:"
if mcEncrypt("Ken Ray" & cr & it) = tEncryptedString then
   -- let 'em in
else
   -- right person/wrong password OR
   -- wrong person/right password
   -- either way, don't let 'em in
end if

Of course there is no "mcDecrypt", so it's kind of a specialized use of 
mcEncrypt. Personally I either use 'ask password clear'or I use a custom stack 
for getting passwords and use my own custom encryption/decryption functions, 
but that's just me…


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/  

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to