title: can I used the Crypto++ to decrypt the aes-cbc-essiv:sha256 (the file is encrypted by linux dm-crypt)
body: <p>Did anyone have to use the Crypto++ to decrypt the file with aes-cbc-essiv:sha256 which is encrypted by linux dm-crypt?
  I tried to used the following code to decrypt the file.
  But it is incorrect.
  Does anyone have the experience before?
  Can you help me?
  Thanks so much.</p>
  
  <pre><code>void decrypt_file(const char* password,
                    const char* inputFileName, const char* outputFileName)
  {
      byte pass[ AES::BLOCKSIZE ];
      byte iv[16];
      byte head_file[16]; 
      memset(iv, 0, 16);
  
      try
      {
        StringSource(password, true,
          new HashFilter(*(new CryptoPP::SHA256),
            new ArraySink(pass,AES::BLOCKSIZE)));
  
        CryptoPP::AES::Decryption
          aesDecryption(pass, CryptoPP::AES::DEFAULT_KEYLENGTH);
  
        CryptoPP::CBC_Mode_ExternalCipher::Decryption
          cbcDecryption( aesDecryption, iv );
  
        StreamTransformationFilter *decryptor =
          new StreamTransformationFilter(cbcDecryption,
            new FileSink(outputFileName),
            StreamTransformationFilter::BlockPaddingScheme::ZEROS_PADDING);
  
        FileSource(inputFileName, true, decryptor);
      }
      catch(CryptoPP::Exception &amp;e)
      {
        printf("Exception \n");
        cout &lt;&lt; "std::exception caught:" &lt;&lt; endl &lt;&lt; e.what();
        return;
      }
  }
  </code></pre>