正在寻找一种方法来加密Mac上的敏感数据文件夹?您可以使用File Vault(File Vault)加密整个硬盘驱动器,但这对大多数人来说可能是矫枉过正。幸运的是,OS X有一个内置功能,允许您创建一个加密的磁盘映像(disk image),其中包含您想要在映像中的任何数据。
打开磁盘映像(disk image)的唯一方法是输入密码。您可以像普通文件一样复制磁盘映像,除非在(disk image)Mac上解锁,否则它将无法读取。总的来说(Overall),这就像创建自己的加密文件容器(file container)。
此外,请务必查看我关于如何安全加密USB 闪存(USB flash)驱动器的文章,这是存储敏感数据的另一种好方法。
创建加密磁盘映像
要在Mac上创建(Mac)磁盘映像(disk image)( DMG ) ,首先创建一个文件夹,其中包含您要加密的所有数据。请注意,一旦您创建了磁盘映像(disk image),原始未加密的文件夹仍将保留在您的系统中,您应该立即将其删除。
要开始使用,请通过转到Applications或单击右上角的Spotlight图标(放大镜)并输入Disk Utility 打开Disk (Disk Utility)Utility(Disk Utility)。
磁盘工具(Disk Utility)打开后,继续并单击File – New Image – Image from Folder。
您现在必须选择要加密为磁盘映像(disk image)的文件夹。
单击打开(Open),您将看到另存为( Save As)对话框,您必须在其中为新图像命名并(name and choose)从几个选项中进行选择。
默认情况下,它会将新磁盘映像(disk image)保存在您正在加密的同一文件夹中。在加密下,您可以选择128 位(128-bit)或256 位 AES 加密(256-bit AES encryption)。由于加密更强,后者会更慢,但您的数据将得到更好的保护。当您选择任何加密选项时,系统会要求您输入密码。
确保(Make sure)输入一个非常长且强度高的密码,因为这是保护您数据的唯一安全措施。如果黑客获得了您的文件,他们可以尝试使用暴力攻击来确定密码。即使在速度非常快的计算机或计算机集群(computer or cluster)上,任何超过 12 个字符的字母、数字和符号都需要很长时间才能破解。
对于图像格式(Image Format),您可以选择只读、压缩、读/写、DVD/CD master或混合图像。出于我们的目的,您应该选择只读或读/写。如果您选择后一个选项(latter option),您可以稍后将更多文件/文件夹添加到您的加密图像中。
单击保存(Save),您的新图像将被创建。请注意,如果您选择 256 位AES 加密(AES encryption),则创建磁盘映像(disk image)可能需要很长时间。
现在,当您打开图像文件(image file)时,会提示您输入密码。确保您没有在我的钥匙串框中选中记住密码。( Remember password in my keychain)
如果您正确输入密码,图像将像驱动器一样安装,如果您为图像格式(Image Format)选择读/写,那么您可以像普通驱动器一样从加密图像中添加或删除项目。当您向驱动器添加内容时,它将自动被加密和保护。
创建空白加密图像
还值得注意的是,您不必一定要从文件夹中创建加密图像。您也可以打开磁盘工具(Disk Utility),然后单击文件(File)-新图像(New Image)-空白图像(Blank Image)。
在这里,您将看到更多选项。首先,您可以指定磁盘映像(disk image)的大小和文件系统格式(file system format)。建议您坚持使用OS X Extended (Journaled),以便支持所有安全功能。
对于Partitions,您可以选择Single partition - GUID Partition Map或Single partition - Apple Partition Map。所有其他设置与前面提到的相同。
总体而言,这是一种保护Mac上的数据免遭窥探的好方法,无需安装任何第三方软件或在整个系统上启用File Vault 。如果您有任何问题,请随时发表评论。享受!
How to Create an Encrypted Disk Image in OS X
Looking for а way to encrypt a folder of sensitive data on your Mac? You could encrypt your entire hard drive using File Vault, but this may be overkill for most people. Luckily, OS X has a built-in feature that allows you to create an encrypted disk image containing whatever data you want inside the image.
The only way to open the disk image is to enter the password. You can copy the disk image like a normal file and it will be unreadable unless unlocked on a Mac. Overall, it’s like creating your own encrypted file container.
Also, be sure to check out my article on how to securely encrypt a USB flash drive, which is another good way of storing sensitive data.
Create Encrypted Disk Image
To create the disk image (DMG) on your Mac, first create a folder that includes all the data you want to encrypt. Note that once you create the disk image, the original unencrypted folder will still remain on your system and you should delete it immediately.
To get started, go ahead and open Disk Utility by going to Applications or by clicking on the Spotlight icon (magnifying glass) at the top right and typing in Disk Utility.
Once Disk Utility is open, go ahead and click on File – New Image – Image from Folder.
You’ll now have to choose the folder that you would like to encrypt as a disk image.
Click Open and you’ll get the Save As dialog where you have to give your new image a name and choose from a couple of options.
By default, it’ll save the new disk image in the same folder that you are encrypting. Under Encryption, you can choose from 128-bit or 256-bit AES encryption. The latter will be slower because of the stronger encryption, but your data will be better protected. When you choose any of the encryption options, you’ll be asked to enter a password.
Make sure you enter a very long and strong password because this is the only security that protects your data. If a hacker gets a hold of your file, they can try to use a brute-force attack to determine the password. Anything over 12 characters with letters, numbers and symbols will take a very long time to crack even on a really fast computer or cluster of computers.
For Image Format, you can choose from read-only, compressed, read/write, DVD/CD master or hybrid image. For our purposes, you should choose either read-only or read/write. If you choose the latter option, you’ll be able to add more files/folders to your encrypted image at a later point.
Click Save and your new image will be created. Note that if you chose 256-bit AES encryption, it could take quite a while for your disk image to be created.
Now when you go to open the image file, you’ll get a prompt asking for the password. Make sure you do NOT check the Remember password in my keychain box.
If you enter the password correctly, the image will be mounted like a drive and if you chose read/write for the Image Format, then you can add or remove items from the encrypted image just like a normal drive. When you add something to the drive, it will automatically be encrypted and protected.
Create Blank Encrypted Image
It’s also worth noting that you don’t have to necessarily create an encrypted image from a folder. You could also open Disk Utility and then click on File – New Image – Blank Image.
Here you will see a couple of more options. Firstly, you can specify the size of the disk image and the file system format. It’s recommended you stick with OS X Extended (Journaled) so that all security features are supported.
For Partitions, you can choose from Single partition – GUID Partition Map or Single partition – Apple Partition Map. All of the other settings are the same as previously mentioned.
Overall, it’s a great way to secure data on your Mac from prying eyes without having to install any third-party software or enabling File Vault on your entire system. If you have any questions, feel free to comment. Enjoy!