Hi,

I wrote the following enc/dec code;

Qt Code:
  1. AES_KEY enc_key, dec_key;
  2.  
  3. AES_set_encrypt_key((unsigned char*)p_key, 128, &enc_key);
  4. AES_ecb_encrypt((unsigned char*)textManip, (unsigned char*)enc_out, &enc_key, 1);
  5.  
  6. AES_set_decrypt_key((unsigned char*)p_key, 128, &dec_key);
  7. AES_decrypt((unsigned char*)enc_out, (unsigned char*)dec_out, &dec_key);
To copy to clipboard, switch view to plain text mode 

& to test it;


Qt Code:
  1. qDebug() << "Original: " << (char*)(text);
  2. enc_out[strlen(p_Text)] = '\0';
  3. qDebug() << "Encrypted: " <<(enc_out);
  4. dec_out[strlen(p_Text)] = '\0';
  5. qDebug() << "Decrypted: " << (dec_out);
To copy to clipboard, switch view to plain text mode 

the output is;

Original: WirofonPC010101
Encrypted: ??c?'r???)?A?
Decrypted: WirofonPC010101

which seems ecryption is working. But I somehow thought that my encrypted characters are no good. I mean Shouldn't they like

"31298sdf788123" or "122dfsdrwer324" ??

Thanks..