Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: hdiutil with encryption
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hdiutil with encryption



Yeah, I didn't really like the idea of sending the echo command, and I also really didn't want to use security to change the keychains since it is so simple in straight AppleScript. I may end up just doing it in AppleScript instead.

Thanks,
Rob Morton


On Nov 17, 2008, at 3:52 PM, Mike Hurley wrote:

Message: 1
Date: Sun, 16 Nov 2008 15:30:49 -0500 (EST)
From: email@hidden
Subject: hdiutil with encryption
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain;charset=iso-8859-1

I am trying to use AppleScript Studio to create an encrypted disk image.
There will be more to it than just that, but this is the part that is not
working as I would expect. I had one that worked as I wanted, but haven't
used it for a while. Something is now different as the command will work
in AppleScript, but not in an AppleScript Studio application.


Here is the basic code...
set Users_Home to (path to home folder) as string

set EncryptedName to display dialog "Enter the name of the new secure
area." buttons {"Cancel", "Create"} default answer "Encypted Space"
default button "Create"
if button returned of EncryptedName = "Create" then
       set EncryptedName to text returned of EncryptedName
       set Secure_Sparse_Image to quoted form of POSIX path of
(Users_Home  &
EncryptedName)

do shell script "hdiutil create -type SPARSE -volname " & quoted
form of
EncryptedName & " -encryption AES-256 -agentpass -size 100g -fs HFS + " &
Secure_Sparse_Image
end if


In AppleScript, it will pop up the asking for a password for the disk
image with the ability to remember the password in the keychain. With
AppleScript Studio, it will simply hang the application. I am assuming it
is silently requesting the password, but I can not see it. Any thoughts or
suggestions?


Thanks,
Rob Morton


The way I handled this was to generate my own dialog asking for the password,
then pipe it to hdiutil with a command like
do shell script ("echo -n " & thepassword & " | hdiutil ... "


I also had to use the "security" command to open the keychain and save the password to it;
details about the security command are in its man page.


Hope this helps,
Mike Hurley
--


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Studio mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: hdiutil with encryption (From: Mike Hurley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.