|
Hello every one,
I'm trying to build a programe using C++ (Compiling it by using MinGW + Command-line, so no GUI is required) that do the following;
first; store files in one binary file, each file composed of metadeta, file deta. The file data is encrypted using a symmetric encryption algorithm. The algorithm is specified in the metadata.
the metadeta contains
File ID
File name
Original file size
Size of the encrypted data
File creation date
File last modification date
Encryption algorithm
Encryption key, which is encrypted using the user public key. The
public key encryption used is RSA with 1024 bit key length.
Checksum, which is computed using the hash function on the file
content. The hash algorithm used is SHA1.
- now when we add a file to the binary one we should do the following;
1. Provide the binary file, the file to be added, the encryption key and the public key
2. Encrypt the file using the encryption key
3. Encrypt the encryption key using the public key
4. Calculate the checksum of the file
5. Check if the file is already added to the binary file; if yes, delete it.
6. Add the metadata to the binary file
7. Add the encrypted file to the binary file
- then when we want to decrypt a file we should do the following;
1. Provide the binary file, the file ID to be extracted, the private key, the path where to extract the file
2. Check the file ID exists in the binary file. If not, return an error
3. Get the file metadata and the file encrypted text.
4. Decrypt the encryption key using the private key
5. Use the encryption key to decrypt the file encrypted text
6. Save the file in the specified path
SO would you please help me with building this programe ? and if there is any code that doing the previous, would you please send it to me?
Thanks in advance
|
|
|
|
|
sorry we dont build solutions for people - if you want that, go to rentacoder.. if you have an issue with a specific piece of code/sdk post it and ask nicely and you may find someone to help ....
I'd suggest you google crypto++ for instance for a toolbox/sdk - then you'll have to work through the examples etc to put it together - there are even some here on CP - there are commercial offerings out there as well that may help .. http://www.di-mgt.com.au/index.html[^] for instance
'g'
|
|
|
|
|
moody123 wrote: SO would you please help me with building this programe ?
Sure. What specifically did you need help with?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
At a minimum starting point:
class CBinaryFile
{
public:
CBinaryFile();
~CBinaryFile();
Add( LPCSTR lpBinaryFile, LPCSTR lpInputFile, LPCSTR lpEncryptionKey, LPCSTR lpPublicKey );
Extract( LPCSTR lpBinaryFile, LPCSTR lpFileId, LPCSTR lpPrivateKey, LPCSTR lpPath );
private:
std::string m_strBinaryFile;
std::string m_strInputFile;
std::string m_strFileId;
std::string m_strEncryptionKey;
std::string m_strPublicKey;
std::string m_strPrivateKey;
std::string m_strPath;
}; The downside to e-mailing me directly is that you are the only beneficiary. Keep the Q&A here so that all may benefit.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Ok David, sorry
i'm waiting
|
|
|
|
|
moody123 wrote: i'm waiting
For what?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi david,
Sorry but i forgot to ask you about (LPCSTR) what is this?
|
|
|
|
|
moody123 wrote: Sorry but i forgot to ask you about (LPCSTR) what is this?
const char *
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I have one com+ exe and one .net service is importing its function to begin the process, now how can i debug my exe, i mean to set a breakpoint or what whenever the service call my exe?
I tried with attach to process but i didnt see any process running.So please give me the way....
Thanks A Ton
Ash_VCPP
|
|
|
|
|
Have you tried Debug.Assert(false) in start of the service. Similarly you can place ASSERT(false) in those COM exes when that segment executed a modal dialog box would appear, you can load that in visual studio.
Regards,
Mushtaque Nizamani
|
|
|
|
|
Hi,
When i installed Rational clearcasetool and restarted system..and when im trying to build my vc++ application in VS 2005 im able to see the below error..
error result returned from 'cl.exe'.
Please help me out..
|
|
|
|
|
cl.exe is the compiler. make the window bigger, or scroll up, and find your missing semicolons.
|
|
|
|
|
Hi friend,
I would like to share several variables between two different processes.
I share a variable between two instances of one application using "#pragma section", I don't know whether I can use "#pragma section" to share variables between two processes or not.
However, please help me how can I share a variable between two different processes?
Thanks in advance.
|
|
|
|
|
If you need to communicate between two different applications, you can have a look at the IPC section[^] on codeproject (IPC=Inter-process communication).
If you want some advice about which technology to use, then you will need to describe what you want to do with more details. Why do you need to share those variables ?
|
|
|
|
|
Hi,
Since I have two applications, the first one is the writer and the second one is the reader and I want to share a memory between them instead of transferring through Messages.
I want to know how to share a memory between these two processes.
Is IPC (Inter-Process Communication) sufficient for me?
Thanks.
|
|
|
|
|
IPC is a generic term regrouping several techniques: sockets, memory-mapped files (shared memory), messages, ...
In your case, what do you want to do exactly ? Is the value of the variable changing ?
|
|
|
|
|
Yes, the data in the variables are changed every 1 second and another application needs to read the recently changed values.
|
|
|
|
|
If the application which should read the data has a message queue (win32 or MFC application for instance), you can use the WM_COPYDATA message. A tutorial here[^]
|
|
|
|
|
|
Hello,
I am using a CAnimateCtrl to show an animation during some lengthy operations (multiple calls to CreateProcess), but the problem is that my animation does not play, because the thread is obviously stuck with CreateProcess. So I need to run the animation in a seperate thread, but am not sure which is the best and shortest way to do this. Is there any good example how this can be achieved?
|
|
|
|
|
I think you should do it the other way around: as your CAnimateCtrl is part of the UI, it should be processed in the main UI thread. Instead, why don't you run your lenght operation in a separate thread ?
|
|
|
|
|
Hi,
I have tried this, but it doesn't work right. I have mutlitple calls to Createprocess, and the problem is that I have to wait for each processto finish until I can start the next one. This is what my code looks like, and I definitely need to ait for the process to finish. Any idea how the animation can run parallely to this code? Thanks alot:
if (!CreateProcess(
strFullPath.GetBuffer(0),
strCmdLine.GetBuffer(0),
NULL,
NULL,
FALSE,
0,
NULL,
GetPathOnly(strFullPath),
&si,
&pi )
)
{
...
return;
}
DWORD nRet;
MSG msg;
while (nRet = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_PAINT | QS_SENDMESSAGE |QS_MOUSEBUTTON ) != WAIT_OBJECT_0)
{
if (nRet == WAIT_OBJECT_0 + 1)
{
while (PeekMessage(&msg, 0, WM_PAINT, WM_PAINT, PM_REMOVE))
{
DispatchMessage( &msg );
}
while (PeekMessage( &msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ));
}
else if (nRet == WAIT_OBJECT_0)
{
break;
}
OnPaint();
}
|
|
|
|
|
Erik wrote: I have tried this, but it doesn't work right.
You have tried what ? Starting a new thread and spawning your processes from within that thread ? It seems not really what you did. If you do that in a separate thread, you don't have to worry about pumping the message queue or repainting or window.
|
|
|
|
|
Hello,
I am facing a strange problem in my c Windows application sigle-threaded, using VS2008 compiler.
errno is used after system calls to identfiy if any error occured. I have placed checks in my code at various places to know if any exception has occured during a flow.
In one of the function, At the beginning of a code block I check for errno occured in previous code block, if errno is zero, the normal flow continues. If errno is non-zero, nothing is done and the function returns with errno.
Now, i found out a strange issue, errno that is initialized to 0 at the start of the function, changes its value to 9 after doing a sprintf call. sprintf call is successfull though. Another strange thing about it is that this happens only when the exe is run as service on Windows Vista. If the same exe is run from Visual Studio debugger, this behavior doesn't happen when exe runs from VS directly in either release or debug mode.
I can not comprehend the behavior, any help will be appreciated.
Thanks.
Gajendra
Gajendra
|
|
|
|
|
No answers at all....Surprising.
Gajendra
|
|
|
|