Category : fstream

Using OpenSSL, I am decrypting an encrypted message by using RSA_private_decrypt(encryption_len, (unsigned char*)encryptedMSG, (unsigned char*)decrypt, privateRSA, RSA_PKCS1_OAEP_PADDING); This code works ^^^ The issue comes when sending the encryptedMSG over a fstream. Decrypting the original encryptedMSG works. But when I send it over an fstream it no longer works? To verify encyptedMSG maintains its value. I ..

Read more

I have an ipk.dat file containing student name and their GPA separated by semicolon. I’m trying to display the names of students who have a GPA greater than 3, but I get output with strange characters like this in the console. Hidayat┬áSari 3.60 Susila┬áBuana 3.27 Krisna┬áSari 3.66 Taufik┬áFatimah 3.38 Bachtiar┬áDarma 3.70 Yohanes┬áAnwar 3.93 Harun┬áRatna 3.48 ..

Read more

So, I’ve been working with school on file i/o streams, the language is C++. I’ve encountered something I can’t find an answer to. friend ifstream& operator>>(ifstream& ist, Student& student) { int size = 0; ist.read((char*)&size, sizeof(int)); student.name.resize(size+ 1); ist.read((char*)&student.name[0], size); return ist; } So, I understand that the first line effectively creates a container so ..

Read more