If this method doesn't work, you can also go to Disk Utility Add Disk Image. Unless you have a third-party tool like 7-Zip or DMG Extractor installed on your computer, you won't be able to open the DMG file. Double-clicking a DMG file on a Windows computer will prompt you to select a program with which to open the file.
In the window that pops up, select the folder you want to encrypt and click the “Choose” button. Open up Disk Utility and choose File New Image Image from Folder (or blank image if you want to make an empty DMG file you can add stuff to later).