Add Encrypt tests, fix bug

The field order of the Decrypt blob was wrong, which was causing decryption to
fail.