On Fri, Jan 24, 2014 at 7:48 PM, Francisco Ares <[email protected]> wrote:
>
> Is it really needed to enclose the string?
>
> What will it happens if you just do
>
> DEFINES += SERIAL=6b6ab0
I'm using an encryption schema based on serial codes. These codes need to
be secret and user-specific (we deliver a new compile of library for each
customer which build-id + serial number is hard-coded into binaries).
Encryption schema is a cipher block chain on AES-256 which generates key
from 32 bytes of data. That data is serial number. That is:
// Hex decode symmetric key:
HexDecoder decoder;
decoder.Put( (byte *)SERIAL,32*2 ); // This is why I need SERIAL
to be wrapped in "
decoder.MessageEnd();
word64 size = decoder.MaxRetrievable();
char *decodedKey = new char[size];
decoder.Get((byte *)decodedKey, size);
// Generate Cipher, Key, and CBC
byte key[ AES::MAX_KEYLENGTH ], iv[ AES::BLOCKSIZE ];
StringSource( reinterpret_cast<const char *>(decodedKey), true,
new HashFilter(*(new SHA256), new ArraySink(key,
AES::MAX_KEYLENGTH)) );
// ....
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest