CS计算机代考程序代写 x86 #pragma once
#pragma once
#include
#include
/// protocol.h defines the messages that a client may send, and the responses a
/// server will provide. Note that the entire request is a single byte stream,
/// as is the entire response. The entire communication between client and
/// server should consist of just two messages. First, the client sends a
/// message (the request), and then the server sends a reply message (the
/// response).
///
/// Different parts of a message may be encrypted in different ways. We
/// indicate this with the ‘enc()’ function. The expression ‘enc(x, y)’
/// indicates that y should be encrypted using key x. Both RSA and AES
/// encryption are used. A unique AES key (aeskey) should be generated each
/// time the client sends an AES-encrypted message to the server. An RSA key
/// (rsakey) is generated by the server once.
///
/// A request always begins with a fixed-size RSA-encrypted block of bytes
/// (@rblock), followed by a variable-size AES-encrypted block of bytes
/// (@ablock). The only exception to this is the KEY request, which consists of
/// a fixed-size unencrypted block of bytes (@kblock). The @kblock or @rblock
/// will always be LEN_RKBLOCK bytes, regardless of whether it is an
/// RSA-encrypted block or the “KEY” message. KEY messages are padded with
/// ‘