I got a strange problem. I filled a text file with the letter 'A' and made it 4096 bytes long. Then a encrypted it with openssl on linux:
KEY="2D242B65C517B72F8D1DAA8278CA5A2ED5D8A95BCF82BFD3778212218726335F" openssl enc -nosalt -iv 0 -K $KEY -aes-256-cbc -in $PLAINIMAGENAME -out $CRYPTIMAGENAME
(No salt, no IV)
Then a tried to create a device-mapper loopback device with dm-crypt:
losetup /dev/loop0 $CRYPTIMAGENAME sudo dmsetup create cryptotest --table "0 4096 crypt aes-cbc-null $KEY 0 /dev/loop0 0"
When I try to read from /dev/mapper/cryptotest I get my A's, but every 512 bytes (block size?) there are 16 bytes of garbage. How is this possible?
When I use the ECB-mode (where every block is encrypted in the same way) everything works fine.
By the way I don't want to use LUKS for loopback encryption, I need a headerless AES stream which can be created by openssl or aespipe.