Hi
I'd like to be able to encrypt some files from a Windows PC onto a USB stick. Could I do this with a LiveCode stack? The files are mostly large (up to 1 GB) Microsoft Access database files. I've looked at the encrypt/decrypt facilities in the LiveCode dictionary but I get the impression that's used for encrypting strings or records, not entire files. I've searched the Lessons for encryption but found nothing.
I'd also like to zip as well as encrypt the files like in WinZip (I can't install WinZip on the Windows PC, which is why I wondered if LiveCode might be an answer.)
Thanks in anticipation
Geoff
Encrypting a file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Encrypting a file
Using LiveCode 9.0.1 for Mac/PC/iOS
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7
Re: Encrypting a file
All windows versions since xp can create zip files (right click, send to..., zip compressed folder). The ability is also available via command line, but does not include the encrypted zip format. See also Wikipedia.
In LC both zip and encryption are supplied as externals, and overtly complex. The encrypted zip format is also not supported. However, it is possible to encrypt anything in a container, and files are part of the definition of "containers" as used in the dictionary. On the other hand, all data would need to be loaded into RAM, putting a practical upper bound on the size of the encrypted data.
In LC both zip and encryption are supplied as externals, and overtly complex. The encrypted zip format is also not supported. However, it is possible to encrypt anything in a container, and files are part of the definition of "containers" as used in the dictionary. On the other hand, all data would need to be loaded into RAM, putting a practical upper bound on the size of the encrypted data.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Encrypting a file
I see. Thanks for that, BvG, very helpful. It would appear that what I'm thinking of wouldn't be practical, loading the entire file into memory. Unless... I see there is a read from file function which would allow me to read in the database file in chunks of say, 1K bytes, encrypt it, and then write it out to a new file. No, it can't be that easy... I'm probably looking at this too simplistically, as I've not done this before!
Thanks
Geoff
Thanks
Geoff
Using LiveCode 9.0.1 for Mac/PC/iOS
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7
Re: Encrypting a file
Hi Geoff,
Please, keep in mind that zip files may be protected by a password, but are NOT encrypted!
You can encrypt big files by reading them piece by piece, say 10MB at a time, and appending the encrypted data to a file, using unique strings to identify the parts. Unfortunately, this might be very slow.
If you have very big files and your data is really sensitive, perhaps you should think of an encrypted external drive?
Kind regards,
Mark
Please, keep in mind that zip files may be protected by a password, but are NOT encrypted!
You can encrypt big files by reading them piece by piece, say 10MB at a time, and appending the encrypted data to a file, using unique strings to identify the parts. Unfortunately, this might be very slow.
If you have very big files and your data is really sensitive, perhaps you should think of an encrypted external drive?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Encrypting a file
Hi
Thanks Mark. Yes, it looks like an encrypted USB stick would be easier. I was hoping to use my new LiveCode skills but never mind...!
Thanks
Geoff
Thanks Mark. Yes, it looks like an encrypted USB stick would be easier. I was hoping to use my new LiveCode skills but never mind...!
Thanks
Geoff
Using LiveCode 9.0.1 for Mac/PC/iOS
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7
MacBook Pro 2019 16GB
macOS Monterey v12.4
2.6 GHz 6-Core Intel Core i7