fix to properly allow NULL bytes in key and plaintext