{"id":21987640,"url":"https://github.com/fraune/createencryptedimage","last_synced_at":"2026-04-06T08:01:14.703Z","repository":{"id":239854184,"uuid":"800789234","full_name":"fraune/CreateEncryptedImage","owner":"fraune","description":"Automator Quick Action for encrypting a folder","archived":false,"fork":false,"pushed_at":"2024-05-17T15:16:54.000Z","size":185,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T03:05:10.866Z","etag":null,"topics":["applescript","automator","automator-workflow","bash","dmg","encryption","macos","quick-action","shell","zsh"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fraune.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-15T02:09:53.000Z","updated_at":"2024-07-14T07:08:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"bea3a06a-d9b6-48c8-aafc-a78c1e937683","html_url":"https://github.com/fraune/CreateEncryptedImage","commit_stats":null,"previous_names":["fraune/createencryptedimage"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fraune/CreateEncryptedImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraune%2FCreateEncryptedImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraune%2FCreateEncryptedImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraune%2FCreateEncryptedImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraune%2FCreateEncryptedImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fraune","download_url":"https://codeload.github.com/fraune/CreateEncryptedImage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fraune%2FCreateEncryptedImage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31464101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","automator","automator-workflow","bash","dmg","encryption","macos","quick-action","shell","zsh"],"created_at":"2024-11-29T19:13:08.796Z","updated_at":"2026-04-06T08:01:14.678Z","avatar_url":"https://github.com/fraune.png","language":null,"readme":"# CreateEncryptedImage\n\n## Description\n\nThis macOS workflow (`Create Encrypted Image.workflow`) is an Automator Quick Action, which adds a context popup on folders in Finder. When activated, the workflow launches a new Terminal window that helps users encrypt a folder and its contents. The resulting DMG disk image requires a password to unlock.\n\n## Installation and Usage\n\n|   |   |\n| - | - |\n| 1. Download this repository as a .zip file | \u003cimg width=\"420\" alt=\"Download fepository as ZIP\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/39f912e0-347e-4a53-90d1-8a727393c3ba\"\u003e |\n| 2. To inspect the script without installing, you can Right Click `Create Encrypted Image.workflow`, and select Open with Automator | \u003cimg width=\"1007\" alt=\"Inspect script with Automator\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/6238e710-d2ed-44f8-8214-ee4705606768\"\u003e |\n| 3. To install the script, right click `Create Encrypted Image.workflow`, and select Open With Automator Installer | \u003cimg width=\"886\" alt=\"Install the workflow\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/67652e7d-90b0-46a0-9a06-129a504095d9\"\u003e |\n| 4. Click Install to register the quick action | \u003cimg width=\"503\" alt=\"Register the quick action\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/5c6b2eae-10c0-45ee-93e2-467198bc4309\"\u003e |\n| 5. Confirm installation, by right clicking a folder, and checking that Quick Actions now contains the workflow | \u003cimg width=\"538\" alt=\"Confirm quick action enabled\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/27572c24-e352-4e08-b468-d0e1686d83d9\"\u003e |\n| 6. A Terminal window will prompt for `sudo`, which is your Mac admin's password. It is required to run the command.\u003cbr\u003e\u003cbr\u003e7. You will be prompted for a password to encrypt the folder with. This is distinct from the `sudo` password, and will be required to decrypt the DMG. | \u003cimg width=\"711\" alt=\"Encrypting a folder\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/acc6622e-0f20-4dc2-8cd5-17fdc0a4f42f\"\u003e |\n| 8. You should see a new file appear at the same location as the folder you encrypted. Double-click it, then enter your password to decrypt it. | \u003cimg width=\"600\" alt=\"Decrypt the image\" src=\"https://github.com/fraune/CreateEncryptedImage/assets/52302810/2de7843d-31b1-4796-a377-51556b590c48\"\u003e |\n\n## Uninstallation\n\nThe workflow installs under `~/Library/Services`. Just delete `Create Encrypted Image.workflow` from there and it's all gone!\n\n## Easier sudo\n\nYou can use Touch ID to authorize `sudo`, which I find pairs nicely with this workflow. See how here:\n\nhttps://gist.github.com/fraune/0831edc01fa89f46ce43b8bbc3761ac7\n\n## Script contents\n\n```applescript\non run {input, parameters}\n    set folderPath to POSIX path of item 1 of input\n    \n    tell application \"Terminal\"\n        activate\n        do script \"sudo hdiutil create -size 20mb -fs apfs -encryption AES-256 \" \u0026 quoted form of folderPath \u0026 \" -srcfolder \" \u0026 quoted form of folderPath \u0026 \"; exit\"\n    end tell\n    \n    return input\nend run\n```\n\n### Script explanation\n\n**Set the folderPath variable to be the input folder**\n\n```applescript\nset folderPath to POSIX path of item 1 of input\n```\n\n**Open Terminal.app, and bring it to the foreground**\n\n```applescript\ntell application \"Terminal\"\n    activate\n    ...\nend tell\n```\n\n**Do the encryption work**\n\n```applescript\ndo script \"sudo hdiutil create -size 20mb -fs apfs -encryption AES-256 '\" \u0026 folderPath \u0026 \"' -srcfolder '\" \u0026 folderPath \u0026 \"'; exit\"\n```\n\nNotes:\n- This is some AppleScript that runs a Bash command, expanding the `folderPath` variable into the hdiutil arguments\n- My understanding is that `-size 20mb` just sets the initial size. The resulting DMG will be more or less, depending on what you encrypt.\n- `-fs apfs -encryption AES-256` sets the filesystem type and encryption type to use. Last I checked, AES-256 is the best encryption supported by `hdiutil` in this context.\n- The `folderPath` variable is used twice: as the input path, and as the output path. The output path will automatically append `.dmg` onto the end of `folderPath` when the command completes.\n\n## TODO:\n\n- [ ] Add notification upon successful completion ([inspiration](https://apple.stackexchange.com/a/385167/475305))\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraune%2Fcreateencryptedimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffraune%2Fcreateencryptedimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffraune%2Fcreateencryptedimage/lists"}