hey thanks duude it worked
Jesus Loves Us Just the way we are! Invite Him into your life today!
hey thanks duude it worked
Jesus Loves Us Just the way we are! Invite Him into your life today!
This is the code snippet for the original binary file encryption program. I just need to convert this so that it can accept any file. Im using the RIjnael class for the encryption and decryption. The purpose is to encrypt and decrypt any file using the same key. void CFileEnDecryptionDlg::Char2Hex(const unsigned char ch, char *szHex) { unsigned char byte[2]; byte[0] = ch/16; byte[1] = ch%16; for(int i=0; i<2; i++) { if(byte[i] >= 0 && byte[i] <= 9) szHex[i] = '0' + byte[i]; else szHex[i] = 'A' + byte[i] - 10; } szHex[2] = 0; } void CFileEnDecryptionDlg::Hex2Char(const char *szHex, unsigned char &rch) { rch = 0; for(int i=0; i<2; i++) { if(*(szHex + i) >='0' && *(szHex + i) <= '9') rch = (rch << 4) + (*(szHex + i) - '0'); else if(*(szHex + i) >='A' && *(szHex + i) <= 'F') rch = (rch << 4) + (*(szHex + i) - 'A' + 10); else break; } } void CFileEnDecryptionDlg::CharStr2HexStr(const char *pucCharStr, char *pszHexStr, int iSize) { int i; char szHex[3]; pszHexStr[0] = 0; for(i=0; iSetWindowText(""); // Get the window Text output->GetWindowText(key); input->GetWindowText(text); int flag = 0; if(key.GetLength()==0) { output->SetWindowText("1234567890123456"); msgbox->SetWindowText("Default Value of key used"); } if(text.GetLength() == 0){ input->SetWindowText("Scolis Technologies Pvt. Ltd."); output->GetWindowText(key); input->GetWindowText(text); flag = 1; } // Initilalize the object rijndael.MakeKey ((LPCTSTR)key); int length = text.GetLength(); if((text.GetLength() % 16) != 0) { // pad up the text while((text.GetLength() % 16) != 0) { text.Insert(length,'0'); length++; } if (flag == 0) msgbox->SetWindowText("Zero
But then wat about loading the contents of the file to encrypt and stuff... do i do it the same way?? cuz i tried using the same method and the encrypted stuff is not the same as the source...:(
Jesus Loves Us Just the way we are! Invite Him into your life today!
ha ha... cool man:-D
Jesus Loves Us Just the way we are! Invite Him into your life today!
Im tryin to write a VC++ application to encrypt any file the user selects. I have done it for a binary file. But have no idea about how to do it if its a video or picture file. What do i do?:doh::confused:
Jesus Loves Us Just the way we are! Invite Him into your life today!