This should be working:
$this->bbcode_second_pass_code('', '# Create 8M image
dd if=/dev/zero of=./test.img count=8 bs=1M
# Set up encryption -- enter a suitable password when asked
cryptsetup --hash sha512 --key-size 512 -v luksFormat ./test.img
# Now attempt to open it, entering the same password
cryptsetup open test.img test')
and indeed it works for me on x86_64, and the Raspberry PI 1. However, it fails on the Raspberry Pi 2 with:
$this->bbcode_second_pass_code('', 'No key available with this passphrase.')
If I create the encrypted image on the rpi2, I can open it on the rpi or x86_64. However, I cannot open any image on the rpi2, regardless where it was created.
Anybody else observing this?
UPDATE: I took the same external hard drive that contains my encrypted image, and connected it to a BeagleBone Black. Guess what: it opens there just fine.
UPDATE: If I set the key-size above to 256, it works. 512 does not work with "No key available with this passphrase."