Thanks Phatt for your reply. you are right!
This is one way. Have you tried to use AES or DES algorithms to de/encrypt the code from being altered during transmission.
As you know, if we have any code and we want to protect the transmitted data from being modified we almost use strong cipher algorithms such as AES or DES. Do you think we can do that when we have sender and reciever microcontrollers (modules)?