anchor.diff:  check_envelope_type(<<"event">>) -> event.
   
   %% ------------------------------------------------------------------
  +
  +get_pkcs5_padding(Packet) ->
  +	PacketLength = byte_size(Packet),
  +	PaddingNeeded = ?AES_BLOCK_SIZE - (PacketLength rem ?AES_BLOCK_SIZE),
  +	binary:copy(<<PaddingNeeded/integer>>, PaddingNeeded).
  +
  +% Decrypt message
  +aes_encrypt(Packet, AESKey, AESVector) ->
  +	% Decrypt message
  +	Padding = get_pkcs5_padding(Packet),
  +	Padded = <<Packet/binary, Padding/binary>>,
  +	crypto:aes_cbc_128_encrypt(AESKey, AESVector, Padded).
   
   % Decrypt message
   aes_decrypt(Packet, #state{aes_key = AESKey, aes_vector = AESVector}) ->
  
positive.code: 
  -include("log.hrl").
  -include("pre_client.hrl").
  
  -record(state, {
  	cookie :: binary(),
  
negative.code: 	{noreply, State};
  
  handle_cast({send, tcp, Type, Channel, Json}, State) ->
  	#state{aes_key = AESKey, aes_vector = AESVector} = State,
  	Bin = build_message(Type, Channel, Json, AESKey, AESVector),
  	gen_tcp:send(State#state.tcp_socket, Bin),
  	{noreply, State};
  
  