Encrypt all files in the "Documents" folder
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Encrypt all files in the "Documents" folder
I have all kinds of text files in the "Documents" folder(specialfolderpath("documents")) and so that they can not change the text in the file I want to encrypt all the files in the folder
how do I do it?
Thank you
how do I do it?
Thank you
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Encrypt all files in the "Documents" folder
I think you have to do that from outside LiveCode,
and it will depend on what operating system you are using.
Why is the text in those documents not stored inside your LiveCode stack?
This would probably make things simpler.
and it will depend on what operating system you are using.
Why is the text in those documents not stored inside your LiveCode stack?
This would probably make things simpler.
Re: Encrypt all files in the "Documents" folder
Text files are stored here:
And is not stored within the LIVECODE because the text changes
Code: Select all
specialfolderpath("documents")
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Encrypt all files in the "Documents" folder
If the text changes I don't see how it can be encrypted.because the text changes
However, if you store the text in fields in a substack of a standalone it can be saved and will be
inaccessible to your customenrs.
Re: Encrypt all files in the "Documents" folder
Can't do that with the "Encrypt" command?
Re: Encrypt all files in the "Documents" folder
There is definitively no reason why that should not work!
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Encrypt all files in the "Documents" folder
Klaus is right, and I am wrong:
-
-
Re: Encrypt all files in the "Documents" folder
So how do I do that?
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Encrypt all files in the "Documents" folder
Well you can start by reading all the stuff in the Dictionary
under ENCRYPT . . .
under ENCRYPT . . .
Re: Encrypt all files in the "Documents" folder
I know how to encrypt text
But I do not know how to encrypt all the text files in "Documents"
But I do not know how to encrypt all the text files in "Documents"
Re: Encrypt all files in the "Documents" folder
Read the text file into a variable, encrypt it and write it back to file.
Important:
"encrypt" returns BINARY data, so you need to write it back to "url("BINFILE: ...")
And later read it in also as BINFILE!
Important:
"encrypt" returns BINARY data, so you need to write it back to "url("BINFILE: ...")
And later read it in also as BINFILE!
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Encrypt all files in the "Documents" folder
Well, I tried and went wrong somewhere:
-
Code: Select all
on mouseUp
answer file "Choose an RTF file to import"
if the result = "cancel"
then exit mouseUp
else
put URL ("binfile:" & it) into XYZ
encrypt XYZ using "aes-256-cbc" with password "richmond62"
ask file "Choose where you wish to export your text"
if the result = "cancel"
then exit mouseUp
else
put XYZ into URL ("binfile:" & it)
get the longFilePath of it
set the itemDelimiter to slash
set the defaultFolder to item 1 to -2 of the longFilePath of it
end if
end if
end mouseUp
Re: Encrypt all files in the "Documents" folder
Or run it through base64 to convert encrypted binary data to text which you can then save as a normal text file (or transmit online)
-
- VIP Livecode Opensource Backer
- Posts: 9824
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Encrypt all files in the "Documents" folder
Desktop or mobile?
And is the goal to provide a high level of protection for extremely sensitive information, or just to prevent the user from accidentally altering their own files?
And is the goal to provide a high level of protection for extremely sensitive information, or just to prevent the user from accidentally altering their own files?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
Re: Encrypt all files in the "Documents" folder
the result of the encrypt command is inside the it variable!
Code: Select all
on mouseUp
local XYZ,tencrypted
answer file "Choose an RTF file to import"
if the result = "cancel" then
exit mouseUp
else
put URL ("binfile:" & it) into XYZ
encrypt XYZ using "aes-256-cbc" with password "richmond62"
put it into tencrypted
ask file "Choose where you wish to export your text"
if the result = "cancel"
then exit mouseUp
else
put tencrypted into URL ("binfile:" & it)
get the longFilePath of it
set the itemDelimiter to slash
set the defaultFolder to item 1 to -2 of the longFilePath of it
end if
end if
end mouseUp