在 Windows 上,您有 Bitlocker。跨平台,您还拥有VeraCrypt ( TrueCrypt的继任者)。但是,如果您想在MacOS中动态加密文件夹,那么最快和最简单的方法是使用磁盘工具(Disk Utility)。
磁盘工具(Disk Utility)是 macOS 操作系统中内置的一项功能,可以执行诸如擦除和格式化 macOS 硬盘驱动器和(wiping and formatting macOS hard-drives)USB 记忆(USB)棒等可移动媒体等操作。但它也可以在 macOS 上获取一个文件夹并使用DMG格式对其进行加密。
DMG 格式(The DMG Format)
如果DMG格式听起来很熟悉,那可能是因为这也是 macOS 软件安装文件的标准文件格式。DMG文件是可挂载的磁盘映像,可压缩其中的文件,这与(DMG)Zip文件压缩文件夹中的Windows文件的方式非常相似。
除了压缩文件,DMG还可以加密它们。就是这样。
在磁盘工具中制作加密文件夹(Making An Encrypted Folder In Disk Utility)
在您的计算机上创建一个新文件夹,并将您要加密的所有文件放入该文件夹中。
现在打开磁盘实用程序(Disk Utility),您可以通过转到应用程序->实用程序找到它。
转到顶部的菜单,然后选择文件->新建图像->文件夹中的图像。
现在导航到您的秘密文件文件夹的位置,在我的例子中是在桌面上。突出显示该文件夹,然后单击“选择”。
在弹出的框中,确认以下内容:
- 加密文件夹的文件名。
- 你希望它保存在哪里。
- 加密标准(一般 128 位就足够了)。
- 将“图像格式”设置为“读/写”。
当您设置加密标准时,会弹出一个密码框,要求您输入所需的密码。
如果您已经有了想要的密码,请输入两次,然后单击“选择”。但是,如果您不确定自己的密码,“验证”框旁边的黑色小钥匙图标是密码助手(Password Assistant)。点击(Click)钥匙打开它。
下拉(Drop)菜单并选择您想要的密码类型。当您这样做时,密码将自动填写在提供的框中。
您还可以指定密码的长度以及质量(Quality)栏将实时更新。
值得指出的是,如果您选择随机密码选项,则需要将其复制并粘贴到某个地方以记住它。或者更好的是,使用密码管理器(use a password manager)。您需要做的最后一件事是被锁定在您自己的加密文件夹之外。
获得所需密码后,关闭密码助手,您将返回此窗口。
单击“保存”开始加密过程。需要多长时间取决于您的加密文件夹有多大。
创建DMG文件后,原始未加密文件夹仍将存在。它不会被Disk Utility删除。因此,您可能想删除该文件夹,但正如我刚才所说,请确保您首先拥有密码副本。否则,您将被永久锁定。
如果您转到新创建的加密DMG文件,然后双击它,它会询问您的密码。不要(Do NOT)勾选钥匙串(Keychain)
选项。
How To Encrypt a Folder On MacOS Using Disk Utility
On Windows, you have Bitlocker. Cross-platform, you also haνe VeraCrypt (successor to TrueCrypt). But if you want to encrypt a folder on the fly in MacOS, then the quickest and easiest way is to use Disk Utility.
Disk Utility is a function built into the macOS operating system and can do things such as wiping and formatting macOS hard-drives and removable media such as USB sticks. But it can also take a folder on a macOS and encrypt it using the DMG format.
The DMG Format
If the DMG format sounds familiar to you then that’s probably because that is also the standard file format for macOS software installation files. DMG files are mountable disk images that compress the files inside them, much the same way a Zip file compresses Windows files in a folder.
As well as compressing files, DMG can also encrypt them.
Here’s how.
Making An Encrypted Folder In Disk Utility
Make a new folder on your computer and put all the files you
want to encrypt into that folder.
Now open Disk Utility which you will find by going to
Applications–>Utilities.
Go to the menu at the top and choose File–>New
Image–>Image From Folder.
Now navigate to the location of your folder of secret files,
which in my case is on the desktop. Highlight the folder and click “Choose”.
In the box that pops up, confirm the following :
- The
file name for the encrypted folder.
- Where
you want it saved.
- The
standard of encryption (128-bit is generally sufficient).
- Set
“Image Format” to “Read/Write”.
When you set the encryption standard, a password box will pop
up asking you to enter your desired password.
If you already have a password you desire, type it in twice and click “Choose”. However, if you are not sure of your password, the little black key icon next to the “Verify” box is a Password Assistant. Click the key to open it.
Drop the menu down and choose what type of password you want.
When you do, a password will auto-fill for you in the boxes provided.
You can also specify how long the password will be and the Quality bar will update in real-time.
It’s worth pointing out that if you go for a random password
option, you are going to need to copy and paste it somewhere to remember it. Or
better still, use a password manager. The last thing you need is to be
locked out of your own encrypted folder.
When you have the password you want, close the Password
Assistant and you will be back at this window.
Click “Save” to begin the encryption process. How long it
will take will depend on how large your encrypted folder is going to be.
When the DMG file has been created, the original unencrypted folder will still be there. It is not deleted by Disk Utility. So you may want to delete that folder, but as I said just now, make sure you have a copy of the password first. Otherwise, you will be permanently locked out.
If you go to your newly created encrypted DMG file, and
double-click on it, it will ask you for your password. Do NOT tick the Keychain
option.