This will create a new disk image notes.dmg that when mounted will be named notes (from -volname). The image will hold up to 10 MB and once created will be populated from the existing ~/notes folder. The -format UDRW makes the image read-write. Omit -format to make a read-only image. The image will be encrypted and will prompt you for the password when it is created and each time it is mounted:

$ hdiutil create -size 10m -srcfolder ~/notes -format UDRW \
-encryption AES-256 -stdinpass -volname notes notes.dmg