Password Encypting/Protecting an individual file

Is there some way to Encrypt and/or password protect an individual file in Lion?
-Mike

And decrypt:
on run
          set f to choose file of type "aes" with prompt "Select AES file to decrypt:" default location alias (the path to desktop folder as text)
          my proceed_(f)
end run
on open f
          if (count of f) is not equal to 1 then
                    display dialog ("More than 1 file was selected") with icon stop buttons {"Cancel"} default button 1 with title "openssl aes-256"
          else
                    my proceed_(f)
          end if
end open
on proceed_(f)
          tell application "System Events" to set finfo to the properties of (f as alias)
          if kind of finfo is "Folder" then
                    display dialog (name of finfo & " is a Folder") with icon stop buttons {"Cancel"} default button 1 with title "openssl aes-256"
          else if kind of finfo is "Alias" then
                    display dialog (name of finfo & " is a an Alias") with icon stop buttons {"Cancel"} default button 1 with title "openssl aes-256"
          else if type identifier of finfo is not "dyn.age80c3px" then
                    display dialog (name of finfo & " is not an AES Encrypted File") buttons {"Cancel"} with icon stop default button 1 with title "openssl aes-256"
          end if
          set pass1 to text returned of (display dialog "Please enter your password" default answer "" with title "openssl aes-256" with hidden answer)
          set encryptedFile to f as string
          set theReversedFileName to (reverse of (characters of encryptedFile)) as string
          set theOffset to offset of "." in theReversedFileName
          set decryptedFile to (reverse of (characters (theOffset + 1) thru -1 of theReversedFileName)) as string
          set decryptedFileBaseName to do shell script "/usr/bin/basename " & quoted form of POSIX path of decryptedFile
          tell application "Finder"
                    if exists decryptedFile then
                              set answer to the button returned of (display dialog (decryptedFileBaseName & " exists. Overwrite?") with icon caution buttons {"Yes", "No"} default button 2 with title "openssl aes-256")
                              if answer is "No" then
                                        error number -128 --> Cancel the script
                              end if
                    end if
          end tell
  -- decrypt:
          try
                    do shell script "/usr/bin/openssl aes-256-cbc -d -salt -in " & quoted form of POSIX path of encryptedFile & " -out " & quoted form of POSIX path of decryptedFile & " -k " & quoted form of pass1
          on error m number n
                    try
                              do shell script "/bin/rm " & quoted form of POSIX path of decryptedFile
                    end try
  activate me
                    display dialog "Bad decrypt." & return & "Possible incorrect password." & return & return & "Deleting output file " & decryptedFileBaseName & " (if it exists)." with icon stop buttons {"Done"} default button 1 with title "openssl aes-256"
                    error number -128 --> Cancel the script
          end try
  activate me
          display dialog name of finfo & " decrypted" buttons {"Done"} default button 1 with title "openssl aes-256"
end proceed_

Similar Messages

  • Password protecting a Zip file in windows 7

    So I am trying to figure out how to password protect a zip file using the built in zipping utility in windows 7.  In windows xp and vista once you have created a zipped file you open the file and select file>add password.
    In windows 7 (currently using pro) there is no "add password" option, anyone have any idea why this is?  Or is there some other way of adding a password to a windows zip file that I am not aware of?  Am I being forced to add a 3rd party
    zip app in order to password protect files? 
    if so my other question is why would such a simple/convenient feature be removed from an operating system that is suppose to be superior then the previous?

    According to the Windows 7 Help file there is no such capability in windows 7:
    Can I protect files or folders with a password?
    No, you can't use a password to protect files and folders in
    Windows. However, some programs that run on Windows allow you to protect individual files with a password. For more information, check the Help for the program you're using.
    There are other ways to protect your files and folders in Windows. You can
    encrypt your files using Encrypting File System (EFS), manually specify who can access the folders or files by setting permissions, or hide them. Choose your method based on how secure the folders or files need to be.
    Encrypting is the most secure, while hiding the folders is the least secure.
    For more information about EFS, see What is Encrypting File System (EFS)? For more information about permissions, see
    What are permissions?
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • How do I password protect a pdf file - getting error messages?

    I'm trying to protect a pdf file (i.e. a tax return printed to PDF) with password to open and password to modify. However I'm getting an error message in a pop up window saying..."The file may be read-only, or another user may have it open. Please save document with a different name, or in a different folder." I'm using WIN 8.1. and I'm using Adobe Acrobat Pro XI (student / teacher version). This is a standalone PC so I can't imaging someone else is using this file. Also I've tried renaming and saving to a different folder (from the folder the original file is saved). I've also looked at properties of the PDF file and its not tagged as read only. Please advise if I'm missing something. Thanks for your help.

    Thanks for responding...I'm getting the same message that I got at first..."The file may be read-only, or another user may have it open. Please save document with a different name, or in a different folder."
    The next day I emailed the file to my work PC and encrypted it with no problems. I have WIN 7 and am using Acrobat 8.0 there. So the problem seems to be with my new PC here at home (i.e. WIN 8.1 and Acrobat XI). Frustrating. I'm betting its some obscure setting in WIN or Acrobat, that is way over my head. Please let me know if you have any ideas. Thanks again.
    Phil

  • Is there a way to password protect a single file in numbers?

    Is there a way to passwork protect a single file in Numbers?

    Not directly no - there is this work-around which should still work on iOS 6, or you could see if any of the third-party email apps in the app store support a password, or just access your account via Safari (you can create a homescreen shortcut for your account's login page)

  • I am unable to password protect a pdf file. Any thoughts. I went to help and none of the options wer

    I am unable to password protect a pdf file. Any thoughts. I went to help and none of the options were available to me.. I pay for pdf conversion to word and excel

    Password protection is ONLY available with Acrobat Standard or Pro. The PDF to Word converter is just what the name implies... PDF to Word... No encryption, no protection.

  • Writing/reading password protected zip/gzip files

    Hello All,
    is there anyway in java that i can
    write/read password protected zip/gzip files??
    thanks in advance.

    Have you looked in the Java Documentation, for instance the java.util.zip package?

  • Creating Password Protected MS WORD File

    Hi,
    i reported a program which creating password protected ms excel file using OLE2 objects in local harddisk of computer.
    can i report same program with ms word file?
    Can somebody help me pls?
    Thanks.

    Hello,
    This is what you require
      GET PROPERTY OF word 'activedocument' = actdoc .
      CREATE OBJECT word 'WORD.APPLICATION' .
      IF sy-subrc NE 0 .
        MESSAGE s000(su) WITH 'Error while creating OLE object!'.
        LEAVE PROGRAM .
      ENDIF .
      GET PROPERTY OF word 'documents' = documents.
      CALL METHOD OF documents 'Add' = newdoc.
      call method of newdoc 'Activate'.
        CALL METHOD OF actdoc 'SaveAs'
        EXPORTING
          #1 = 'C:\file.doc'          "filename
          #2 = 1                      "fileFormat
          #3 = 0                      "LockComments
          #4 = 'passopen'             "password to open a workbook
          #5 = 0                      "AddToRecentFiles
          #6 = 'passmod'.             "password for write access

  • Password protect a Numbers file

    Hello friends, I was wondering how to password protect a numbers file. I'm creating a financial report and only some eyes can see it. Anyway to force a user to enter a password before it opens is the goal. I appreciate your assistance. Gary

    I advice against using the built in password function for really confidential data.
    Apple has not specified what level of encryption is used, and it is possible that the encryption level is so low that any hacker can open the file.

  • PASSWORD protect an INDIVIDUAL PAGE

    IWEB certainly is a useful publishing tool, but I have come up against an issue. Is it possible to password protect an individual page of a site? I can't seem to find a way to do this?

    My understanding is no. You can create a second site that is password protected and link to a page within that site. Remember the password protection only works aon pages posted to your .Mac account.

  • How do you change the password protection for a file if you forget it?

    How do you change the password protection for a file if you forget it?

    Certainly not with Reader...

  • How to protect a pdf file by a password

    Hi,
    I have written a program to send payslip through email . This mail sends the payslip as a PDF attachment.
    I want to password protect that PDF document, so that it asks for a password before being opened by the employee.
    Your suggestions will be highly appreciated.
    Domenico.

    Hi
      You can get the idea by having a look on these links.
    Password protection of pdf attachment
    SAPSCRIPT to PDF With Password
    Password Protection of PDF file generated thru SAP
    Regards,
    Sreeram

  • I'm trying to password protect a pdf file but I can see the bottom 1/3 of the window - how do I resize

    I'm trying to password protect a pdf file but I can see the bottom 1/3 of the window - how do I resize

    Do you know what the maximum resolution of your screen is?

  • How to password protect a zip file

    How can I password protect a zip file and if I email the file will the recipient need the password?

    I found a nifty tip to encrypt a zip file that is built into OSX.  The only issue is you have to use the command line (Terminal).  If you don't mind a little tinkering here is how you can encrypt your files to an encrypted zip without buying any other program.
    1. Open up a Terminal window on your mac
    2. Navigate "cd" to the directory where the file you what to make an encrypted zip file.
    3. Type:
         zip -e SecretEncryptedFile.zip FileToEncrypt.txt
    Note: the man pages have more than you ever wanted to know about the zip command: "man zip"
    To unencrypt simple double click on the file and type the password.  I have also unencrypted the files on a PC.

  • Password Protection for pdf file

    Hi Gurus,
      Wish u happy new year
       Is there any possibility for giving the password for the pdf file from SAP so that it should be password enabled. Now am able to send the pdf file  attachment through mail. But my requirement is I have to give the password facility to the pdf file so that when the user wants to see the pdf file in mail it should ask that password.
      Hope my requirement is clear.
    Points will be awarded
    Thanks
    Ravi

    Hi Gurus,
      Any Solution
    Thanks
    Ravi

  • My Time Machine can only restore individual files or empty folders

    Having upgraded to Snow Leopard, I find that when trying to restore a folder of files from my Time Machine HD one of two things happen: either it copies the folder but not the files within it, or it says I don't have the permissions to copy the folder, and then copies the folder anyway - albeit without its contents. If I restore an individual file, I have no problems - but this is hardly going to provide the security promised by Time Machine if I need to restore a project of files saved in a nest of folders, or worse still restore an entire HD.
    I have repaired disk permissions on my Mac, I can't repair permissions on my TM drive (it is greyed out in Disc Utility) and so have erased my TM drive and done a new TM backup of my Mac under Snow Leopard hoping this would solve the problem...
    It hasn't! Any suggestions?
    I can however connect my G4 Powerbook running Leopard on my WiFi network to the TM drive, and restore folders to it as normal which suggests the issue is to do with the Snow Leopard upgrade...
    Jog!

    I solved my TM-Problem:
    The problem was based on incorrect permission and owner settings in my user folder.
    I created a new user and copied the files from the corrupt user folder to the new user folder and corrected the permissions and owner settings.
    More information here:
    http://support.apple.com/kb/HT2963?viewlocale=en_US
    Seems that there is a more simple an efficient method:
    "Note: In Mac OS X 10.5 and later, while started up ("booted") from the Mac OS X 10.5 installation disc, a user's home directory permissions can be reset using the Reset Password utility."
    Message was edited by: brachi

Maybe you are looking for

  • At end of tether, dial up was more reliable!

    On Jan 4th my broadband completely died. I reported it and was told that "hopefully the problem would be fixed by Monday 9th. On Sunday 8th an engineer arrived and spent the whole day sorting out my line................ end result was that he replace

  • MRP Run Against Sales order

    Can you run MRP against a sales order , if so which tcode can i use to accomplish this. Thank you

  • Project planning board report to microsoft project report

    hi all good morning i want to convert the project planning board report to Microsoft project and primavera report ... please guide me through the steps...... Thanks in advance Surya

  • PL-SQL procedure to fix Recycle Algorithm issues with Advanced Outbound

    Dear all, A customer is using Oracle Advanced Outbound 11.5.9. and we have an issue with recycle Algorithm. The issue is that for some cases we get outcome 32, 37 which is cache expired in table iec_g_return_entries and not the original outcome that

  • E-recruitment BSP pages in EHP3

    Hi,       Can we integrate BSP pages in E-recruitment(EHP 3), as BSP iViews in portal. Regards, Anand Edited by: Kirupanand Venkatapathi on Jun 5, 2009 2:15 PM