Hi jacek,
One problem in crypto++5.4 library. In the sample code test.cpp provided by crypto++ library, it tells me
Qt Code:
  1. - To encrypt a file with AES in CTR mode
  2. cryptest ae input output
To copy to clipboard, switch view to plain text mode 
but when I pass these as arguments in command line I get this error
Qt Code:
  1. "CryptoPP::Exception caught: AES/CTR: 1 is not a valid key length"
To copy to clipboard, switch view to plain text mode 
Then I went through the code to check what is wrong?? I realized I need to pass 6 arguments namely
Qt Code:
  1. cryptest ae key IV input output
To copy to clipboard, switch view to plain text mode 
where IV is initialization vector

Now I have one question, Suppose I have a password "somepassword". How do I calculate key and IV for this somepassword. I tried using some dummy value

Qt Code:
  1. "2b7e151628aed2a6abf7158809cf4f3c" as my key;
  2. "000102030405060708090a0b0c0d0e0f" as my initialization vector;
To copy to clipboard, switch view to plain text mode 
The file got encrypted. But I want to calculate key and IV based on password.

Please tell me using some sample code. I'll be thankful to you...

Then there is another problem.
crypto++ library gives code for only encryption. How can I decrypt the file with same password "somepassword". I tried using decrypt instead of encrypt, but I'm not sure what I'm doing is correct or not.

Here is the sample code for decryption
Qt Code:
  1. void AES_CTR_Decrypt(const char *hexKey, const char *hexIV, const char *infile, const char *outfile)
  2. {
  3. SecByteBlock key = HexDecodeString(hexKey);
  4. SecByteBlock iv = HexDecodeString(hexIV);
  5. CTR_Mode<AES>::Decryption aes(key, key.size(), iv);
  6. FileSource(infile, true, new StreamTransformationFilter(aes, new FileSink(outfile)));
  7. }
To copy to clipboard, switch view to plain text mode