Re: encrypt filenames program

rino100@xxxxxxxxx wrote:
can anyone tell me why this program doesn't work if you give filenames
with a "space line space".. like
file - 2005.bzip

here it is:
> ...
cin >>infilename;
ifstream input(infilename.c_str());

Just exactly what value does infilename have here?
Is it "file -"? or "file"? or what?

Note: Your issue is not cryptographic. You'd get better answers at a newsgroup for C++.

> iv="àc€­Õ=Xòžy"; //default bloc

This sure looks like dubious coding.

> StreamTransformationFilter stfEncryptor(cbcEn, new StringSink(
> outfilename ) );
> ...
> rename(infilename.c_str(),outfilename.c_str());

Storing binary data in a string is bad practice enough, but how can you expect the operating system to rename a file to arbitrary binary data? E.g., what do you expect is to do if there's an embedded NUL character?

--Mike Amling