type confusion : encrypting socket data by crypto++/AES_cbc

  aes, c++, crypto++, encryption, sockets

c++ is killing me, i know this question is little chaos, could someone give me some tips or links.

my purpose: receiving data form socket, encrypt it by crypto++/AES_cbc, and then send the encrypted data and IV to proxy server (python or java), and decrypt data at server side.

problem_1:
c++ get vector(char) data type from socket. so i convert vector(char) to string for crypto++ StringSource, after encryption, do i have to convert string to vector(byte) for sending? because server side is Python or java, receiving data in byte type.

problem_2:
i have to convert IV to string by CryptoPP::Base64Encoder for sending together with encrypted data(string), but how to convert string IV back to CryptoPP::SecByteBlock ?

problem_3:
maybe I get totally wrong direction to do this, is there a clear and simple way for it? for example, get byte type from socket and encrypt with cryptoPP::vector(byte) and send out with IV byte?

Source: Windows Questions C++

LEAVE A COMMENT