• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Encrypt/Decrypt a Text File
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Encrypt/Decrypt a Text File


  • Subject: Re: Encrypt/Decrypt a Text File
  • From: Iurista GmbH <email@hidden>
  • Date: Wed, 13 Aug 2014 18:01:08 +0200

Am 29.07.2014 um 19.19 schrieb Eric Geoffroy:

> OpenSSL is on every Mac and lots of Unix distros. Nothing to install. Super easy. Super secure.
>
> This is the basic command to encrypt a file:
>
> openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc
>
> Decrypt-
>
> openssl aes-256-cbc -d -a -in secrets.txt.enc -out secrets.txt.new

I have tried to put that into an applescript like this

tell application "Finder"
	set sel to selection
	set theItem to item 1 of sel
	set Datei to theItem as alias as text
	set Dateiname to name of theItem
	set DateiPfad to container of theItem as alias as text
end tell

set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"

set Pfad0 to text items 2 thru end of DateiPfad
set AppleScript's text item delimiters to "/"
set Pfad to (Pfad0 as text)

set AppleScript's text item delimiters to oldDelim


set INPUT to ("/" & Pfad & Dateiname)
set OUTPUT to (INPUT & ".enc")
log INPUT
log OUTPUT

do shell script ("openssl aes-256-cbc -a -salt -in " & INPUT & " -out " & OUTPUT) with administrator privileges

When running, it asks for my login password, but after having entered successfully the password, the script throws an error 1 ("error "bad password read" number 1) instead of asking for the ecription password.
What do I have to add?

Thanks for advice
Rudolf
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: Encrypt/Decrypt a Text File
      • From: RenĂ© v Amerongen <email@hidden>
  • Prev by Date: Re: Send Mail Headers and Contents to BBEdit
  • Next by Date: Re: Encrypt/Decrypt a Text File
  • Previous by thread: Re: Send Mail Headers and Contents to BBEdit
  • Next by thread: Re: Encrypt/Decrypt a Text File
  • Index(es):
    • Date
    • Thread