예제 #1
0
파일: crypto.cpp 프로젝트: GoBudokai/ozifi
std::string DecryptSymmetrical(const std::string& key, const TBuffer& data) {
    assert(key.size() == AES::MAX_KEYLENGTH + AES::BLOCKSIZE);
    string result;
    result.resize(data.Size());
    CFB_Mode<AES>::Decryption cfbDecryption((byte*)key.data(), AES::MAX_KEYLENGTH,
                                            (byte*)key.data() + AES::MAX_KEYLENGTH);
    cfbDecryption.ProcessData((byte*)result.data(), (byte*)data.Data(), data.Size());
    return result;
}
예제 #2
0
파일: client.cpp 프로젝트: GoBudokai/ozifi
void TClient::SendOfflineMessage(const string& friendLogin, const TBuffer& data) {
    string response;
    response.resize(1);
    response[0] = RT_SendMessage;
    TOfflineMessage offlineMessage;
    offlineMessage.set_friendlogin(friendLogin);
    offlineMessage.set_encryptedmessage(data.Data(), data.Size());
    response += offlineMessage.SerializeAsString();
    response = EncryptSymmetrical(State.sessionkey(), Compress(response));
    UdtClient->Send(Serialize(response));
}
예제 #3
0
void TVocaGuiApp::OnCaptcha(const TBuffer& data) {
    qDebug() << Q_FUNC_INFO;
    QImage captchaImage;
    captchaImage.loadFromData((const unsigned char*)data.Data(), data.Size());
    emit CaptchaAvailable(captchaImage);
}