[Interest] Fwd: Defining a string in qmake command line
Soroush Rabiei
soroush.rabiei at gmail.com
Fri Jan 24 20:52:34 CET 2014
On Fri, Jan 24, 2014 at 7:48 PM, Francisco Ares <frares at gmail.com> 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)) );
// ....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140124/26ea84a9/attachment.html>
More information about the Interest
mailing list