The use of loop-aes requires the kernel module loop.o and the aes key to be fed
using standard input and uuencoded. The loop-AES.README is at
An example from that document to fill an encrypted partition with random data is as follows:
head -c 15 /dev/urandom | uuencode -m - | head -n 2 | tail -n 1 \
| losetup -p 0 -e AES128 /dev/loop3 /dev/hda666
dd if=/dev/zero of=/dev/loop3 bs=4k conv=notrunc 2>/dev/null
losetup -d /dev/loop3
This example uses a random key with loop-aes, then a dd fill of zeros is converted
to random ciphertext. Note the uuencoding of /dev/urandom output and it being
piped into losetup.