Generally, I can create a encrypted ext4 image by do this:
fallocate -l 6553600 encrypt.img
losetup -f encrypt.img
dmsetup create encrypt_disk --table "0 12800 crypt aes 32BYTEKEY 0 /dev/loop0 0"
mkfs.ext4 /dev/mapper/encrypt_disk
Then I can mount /dev/mapper/encrypt_disk to a directory and all files in this disk will be encrypted automatically. And I got a encrypt.img. It can loaded by dmsetup in the next time.
Here is my question: Can I make a encrypt.img by using openssl tools instead of dmsetup? Maybe it will like this:
fallocate -l 6553600 encrypt.img
losetup -f encrypt.img
mkfs.ext4 /dev/loop0
openssl aes ...
Thank you.