{NOTE : I Tried to google this first but sorry i did not get to my specific point}
In the following few lines i will explain the trick that i am worry about , and an explanation for my exact problem
Trick :
Past i used to crack a program using fake server response
1- Looping back the connection of the program (client) to my computer
2- Sniffing the Login successful packet from the real server
3- Creating a fake server (listener) that listens for a connection from the client and sends back the fake response ( that i sniffed )
But it has not been alot of time since they changed something and my trick did not work any more
(Every time i try to send some sniffed login packet the client crashes and no longer accepts the fake server responses)
________
Problem :
Now i am creating my own client server communication and i want to prevent my client from getting fooled by the fake server response trick (anyone can login with any username and password) and provide the best security from eavesdropper
(How to make sure that this packet came from my server and not from other fake server that just sends the sniffed login succeed packet to fool my client and login)
(In another way How to prevent the client from being fooled but a fake server (emulator))
Note : i mean by prevent not to make it 100% secure cuz everything can be cracked but to avoid this kind of silly things that destroys the whole project
_________
I Hope i did not went away from the point but i just wanted to explain every single point clearly
Over 110 views !! and no single replay , i think i am more than clear in my question