Encrypted data isn't shown via debugger

Hi,

I'm using the following aes encryption/decryption code to encrypt & decrypt my data.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
    unsigned char * enc_out = new unsigned char(200*sizeof(char)); 
    unsigned char * dec_out = new unsigned char(200*sizeof(char));

    AES_KEY enc_key, dec_key;

    /* encryption */
    AES_set_encrypt_key((unsigned char *)p_key.c_str(), 128, &enc_key);
    AES_encrypt((unsigned char *)p_Text.c_str(), enc_out, &enc_key);  

    /* decryption to test */
    AES_set_decrypt_key((unsigned char *)p_key.c_str(), 128, &dec_key);
    AES_decrypt(enc_out, dec_out, &dec_key);

    qDebug() << "decrypted:" << QString((char*)dec_out);
    qDebug() << "encrypted:" << QString((char*)enc_out);


I do decryption to verify my encryption. The problem is;

 
qDebug() << "decrypted:" << QString((char*)dec_out);


shows the data encrypted as expected but;

 
qDebug() << "encrypted:" << QString((char*)enc_out);


turns empty string.

If the problem would be in the encryption, decrypted data would be problematic too. Could be anything to do with VS2010 debugger. ie. doesn't show encrypted data..

Regards
Last edited on
No.
It could be that the encrypted string contains strange characters that can't be printed correctly.
Topic archived. No new replies allowed.