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
i'm just a beginner and i'm really needing help to implement the previous solution :(
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
Needing a real help :(
Started by Moody_87, Mar 17 2009 03:35 AM
9 replies to this topic
#1
Posted 17 March 2009 - 03:35 AM
|
|
|
#2
Posted 17 March 2009 - 08:19 AM
What do you have so far?
#3
Posted 17 March 2009 - 08:55 AM
so far all what i have is just a lot of tries but without an obvious code,
the idea now is that i need two classes, one for the adding operation, and the other one for extract operation.
the idea now is that i need two classes, one for the adding operation, and the other one for extract operation.
#4
Posted 17 March 2009 - 10:42 AM
Even a simple main function is more than nothing. If you post what you have, however incomplete, then we can guide you to the next piece to add.
#5
Posted 17 March 2009 - 11:31 AM
ok so far this is what i have
class CBinaryFile
{
public:
CBinaryFile();
~CBinaryFile();
Add( LPCSTR lpBinaryFile, LPCSTR lpInputFile, LPCSTR lpEncryptionKey, LPCSTR lpPublicKey );
Extract( LPCSTR lpBinaryFile, LPCSTR lpFileId, LPCSTR lpPrivateKey, LPCSTR lpPath );
private: // these member variables may not be necessary if the arguments // passed to the above methods do not need to be used elsewhere
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;};
#6
Posted 17 March 2009 - 11:45 AM
What is LPCSTR?
#7
Posted 17 March 2009 - 12:15 PM
LPCSTR = const char *
#8
Posted 17 March 2009 - 01:14 PM
OK, now you have to implement the Extract method. Step one: open the file in binary mode.
#9
Posted 17 March 2009 - 01:19 PM
I think that first we have to implement the add method to test the extract one right?
i've tried many ways to move a file into another bin file but i've failed, so do you have any idea?
i've tried many ways to move a file into another bin file but i've failed, so do you have any idea?
#10
Posted 17 March 2009 - 05:12 PM
Fair enough, but you still need to be able to open the file in binary mode. Once that's done, you can think about properly writing the data to it.


Sign In
Create Account

Back to top









