Page 1 of 1
Creating a password-protected (encrypted) disk image?
Posted: Mon Oct 17, 2016 7:03 pm
by Mag
I think it's not possible, but I ask to see if somebody has some ideas about... is it possible to create a password-protected (encrypted) disk image under macOS with LiveCode?

Re: Create a password-protected (encrypted) disk image?
Posted: Mon Oct 17, 2016 7:20 pm
by AxWald
Hi,
no MacOS here, but in Win I'd just use 7zip. Putting the image into a password protected archive, via cmd line & shell call. I'm sure one of the Mac or Unix tools available for you can do this, too.
Have fun!
Re: Creating a password-protected (encrypted) disk image?
Posted: Fri Oct 21, 2016 3:32 pm
by Mag
Thank you axwald, do you know if there is a tutorial available to use cmd line & shell call?
Re: Creating a password-protected (encrypted) disk image?
Posted: Sat Oct 22, 2016 12:24 pm
by AxWald
Hi,
7-zip itself is at:
-
SourceForge download page or at:
-
7-Zip download page
The documentation ("7-zip.chm") is included in the program package (and in my demo).
I have a link to a
3rd party HTML version too (only cmd line part) that looks innocent. *1)
The files needed to use 7-Zip as cmd line tool are in the "7-Zip Extra" packages.
A tiny stack that demonstrates the procedure is attached (script in button). You need to place a "7za.exe" (cmd line engine from a "extra package") into the folder "externals" - it's too big for the forum (637 KB).
For Linux/ Mac, there's similar tools afaik. 7-zip has some ports (see the web sites above), but I didn't try these yet.
Have fun!
*1): 7-Zip is a popular tool, so be cautious - its quite easy to find infected or malevolent versions of it. But we are smart and only grab our software from trusty sources, right?
Re: Creating a password-protected (encrypted) disk image?
Posted: Sat Oct 22, 2016 12:41 pm
by Mag
Thank you so muc AxWald for the very useful info!
PS
Yes, we only grab our software from trusty sources!

Re: Creating a password-protected (encrypted) disk image?
Posted: Sat Oct 22, 2016 6:30 pm
by AxWald
Hi,
about trusty sources: I just found out that a port of 7-Zip is in at least the Debian repositories (as "p7zip"), and on my Linux Mint 18/ Mate it's actually installed by default. So the demo stack should run there, with a minimal modification ;-)
The cmd line tool I use ("7za.exe") comes in the package "p7zip-full" and can be invoked simply by "7za".
Have fun!
Re: Creating a password-protected (encrypted) disk image?
Posted: Sat Jan 26, 2019 7:34 am
by cstiger004
I agree the 7zipguides is impressed me with the completeness of its feature set, and the ease of used...Thanks for recommending this...
Re: Creating a password-protected (encrypted) disk image?
Posted: Thu Apr 23, 2020 7:56 pm
by tperry2x
You could use
put "hdiutil create -volname 'targetvol' -encryption -srcfolder 'pathtodatafolder' -ov -format UDRO 'nameofnewdmg.dmg'" into mycmd
put shell(mycmd)
-- targetvol (What your disk image icon name will be)
-- pathtodatafolder (can be a folder or existing drive) - where the data is copied from
-- 'nameofnewdmg.dmg' (destination dmg file).
the encryption flag in the command will cause OSX to display a dialog when creating the DMG asking you to choose a password.