encryptedData = originalData ^ key;
encryptedData = originalData ^ key;
encryptedData ^= 52955258604;
encryptedData ^= 25435347522;
encryptedData ^= 25435443543;
I want to know if the following XOR encryption should be hard to crack or not:It is absolutely the same!! (And as mentioned not hard to crack at all) Doing those extra XOR operations is just like doing 1 XOR wih a different value for "key".
Probably it's much harder than using:
which one would you suggest for file encryptionAs a starting point, I would probably look at AES.
ASKER
ASKER
ASKER
ASKER
encryptedData = originalData ^ key;
encryptedData ^= 52955258604;
encryptedData ^= 25435347522;
encryptedData ^= 25435443543;
is equivalent tokey ^= 52955420153;
encryptedData = originalData ^ key;
ASKER
ASKER
I don't know how else to say it and as I'm not in the habit of repeating myself to someone who isn't listening
ASKER
ASKER
ASKER
ASKER
ASKER
static unsigned char key[32] =
{
0x4E, 0x46, 0xF8, 0xC5, 0x09, 0x2B, 0x29, 0xE2,
0x9A, 0x97, 0x1A, 0x0C, 0xD1, 0xF6, 0x10, 0xFB,
0x1F, 0x67, 0x63, 0xDF, 0x80, 0x7A, 0x7E, 0x70,
0x96, 0x0D, 0x4C, 0xD3, 0x11, 0x8E, 0x60, 0x1A
};
ASKER
byte *Encrypt(byte *data, unsigned char key[])
{
// Code goes here...
}
byte *Decrypt(byte *data, unsigned char key[])
{
// Code goes here...
}
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
AutoSeededRandomPool rnd;
// Generate a random key
SecByteBlock key(AES::DEFAULT_KEYLENGTH);
rnd.GenerateBlock( key, key.size() );
// Generate a random IV
byte iv[AES::BLOCKSIZE];
rnd.GenerateBlock(iv, AES::BLOCKSIZE);
char plainText[] = "Hello! How are you.";
int messageLen = (int)strlen(plainText) + 1;
//////////////////////////////////////////////////////////////////////////
// Encrypt
CFB_Mode<AES>::Encryption cfbEncryption(key, key.size(), iv);
cfbEncryption.ProcessData((byte*)plainText, (byte*)plainText, messageLen);
//////////////////////////////////////////////////////////////////////////
// Decrypt
CFB_Mode<AES>::Decryption cfbDecryption(key, key.size(), iv);
cfbDecryption.ProcessData((byte*)plainText, (byte*)plainText, messageLen);
ASKER
int messageLen = (int)strlen(plainText) + 1;
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.
TRUSTED BY
ASKER
Open in new window
Probably it's much harder than using:
Open in new window
I also want to know how to load the decrypted data into LPCVOID
The library that you have provided looks great, but I see different types of encrpytions, which one would you suggest for file encryption.