Page 1 of 1

encrypt word

Posted: Mon Jul 23, 2012 8:13 am
by link76
how can I encrypt / decrypt my password in a txt file?

thank you

Re: encrypt word

Posted: Mon Jul 23, 2012 10:47 am
by Mark
Hi,

It depends on why you want to encrypt it. Look at the encrypt function in the LC dictionary.

Kind regards,

Mark

Re: encrypt word

Posted: Thu Jan 10, 2013 9:17 am
by genie
As per dictionary, Encrypt and Decrypt command works on Mac, Windows, & Linux.

How do I DECRYPT on mobile?


Thanks,
Genie

Re: encrypt word

Posted: Thu Jan 10, 2013 1:36 pm
by Klaus
http://forums.runrev.com/phpBB2/viewtop ... 743#p66329

Please read the "Android Release Notes" (Livecode: Menu: Help) and you will see that
encryption is not (yet) supported on ANDROID by Livecode.

The "XXX Release Notes" are the ONLY docs we have for the mobile platform!

Re: encrypt word

Posted: Fri Jan 11, 2013 12:30 am
by Simon
Hi Genie,
Would obfuscation instead of encryption work for you?

OK all you cipher guys can start laughing now. :oops:
I think the original encryption was just a letter placement number e.g. a=1, b=2, c=3 etc.

Code: Select all

function pencrypt pText
   replace comma with "#&" in pText
   put "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9,0, ,1,@,#,$,%,^,&,*<(,),#&" into tPos
   put comma & "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" after tPos
   set the caseSensitive to true
   repeat for each line tLine in pText
      repeat for each char tChar in tLine
         put itemoffset(tChar,tPos) & comma after tMult 
      end repeat
      put cr after tMult
   end repeat
   return tMult
end pencrypt

function pdecrypt pText
   put "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,1,2,3,4,5,6,7,8,9,0, ,1,@,#,$,%,^,&,*<(,),#&" into tPos
   put comma & "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" after tPos
   set the caseSensitive to true
   repeat for each line tLine in pText
      repeat for each item tItem in tLine
         put item tItem of tPos after tMult 
      end repeat
      put cr after tMult
   end repeat
   replace "#&" with comma in tMult
   return tMult
end pdecrypt
and there it is.
Your post above becomes:
48,19,37,16,5,18,37,4,9,3,20,9,15,14,1,18,25,40,44,37,52,14,3,18,25,16,20,37,1,14,4,37,51,5,3,18,25,16,20,37,3,15,13,13,1,14,4,37,23,15,18,11,19,37,15,14,37,60,1,3,40,44,37,70,9,14,4,15,23,19,40,44,37,44,37,59,9,14,21,24,

55,15,23,37,4,15,37,56,37,51,52,50,65,72,63,67,37,15,14,37,13,15,2,9,12,5,


67,8,1,14,11,19,40,44,
54,5,14,9,5,

By re-ordering the letters in tPos it becomes more obfuscated.
Note that this is NOT encryption and can be broken if someone wanted to try. I would NEVER use this for a commercial product. But as you stated it was a "password" there is little chance of character repetition which is one way codes are broken. I guess this makes a "hangman" game.
A much better obfuscation was done by Richard Gaskin here:
http://livecodejournal.com/tutorials/ha ... s-005.html

Everybody can stop laughing now :D
Klaus, yes I did leave out your "delete the last char" :D

Simon