I found the length using seekg and tellg, then read them into an unsigned char*. The debugger is showing incorrect text though.
ifstream is (infile, ifstream::binary);
//find length
is.seekg (0, is.end);
int length = is.tellg();
is.seekg (0, is.beg);
char * buffer = new char [length];
is.read (buffer,length);
//delete[] buffer; removed
//size_t cipherTextLength = length; removed
//unsigned char* cipherText = new unsigned char[cipherTextLength]; removed
//is.read (reinterpret_cast<char*>(cipherText),length); removed
edit:
text file is something like this:
.l F4"w2ÍögPl Ð l œ›” ÿÿÿPl (goes on)
debugger shows something like:
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍýýýý««««««««þîþîþîþ
edit: now textfile only shows . l
and debugger shows .\xl