We know that radio waves are used in communication with rockets, space crafts and satellites. Now, radio system basically consists of transmitter and receiver. If there is frequency match between receiver and transmitter, then communication link is set up. But then, how is it possible to protect your satellite from unauthorised access by other countries on Earth who are able to produce similar/exact operating frequency radio waves matching the rocket components or space crafts? Is there some kind of encryption method to prevent such events?
At least for the Space Shuttle, commands to the orbiter from the ground were routinely encrypted.
Communications security (COMSEC) equipment provides the capability for encryption / decryption of operational data aboard the orbiter. The COMSEC equipment works with the NSPs to provide selectable transmit, receive, and record combinations under NSP mode control.
The NSP routes data of the indicated type through the COMSEC encryptor or decryptor as appropriate and gets the data back from the COMSEC line-replaceable unit encrypted or decrypted; if "BYP," the indicated data are handled directly by the NSP, and the COMSEC is bypassed.
The three ENCRYPTION switches on panel A1L provide power and routing control for encrypted data through the NSP. Our current operational mode is to use the COMSEC in the SELECT/RCV mode - only the uplink (voice and commands) is encrypted.
Shuttle Crew Operations Manual, page 2.4-9 Emphasis mine
A1L - Orbiter panel in the aft left flight deck
BYP - Bypass
NSP - Network Signal Processor
RCV - Receive
Personal note: After the Department of Defense dropped out of the Space Shuttle program, the room containing this COMSEC equipment was the only classified, extra-security room in the Shuttle Mission Simulator building.
Early satellites were not protected. In fact there was at least one case where satellite was lost because rogue radio transmission got into command link and at least another (Kosmos-785, 1975) where spontaneous error in transmission was misinterpreted as self-destruction command. Security through obscurity (and a need to use fairly expensive and bulky hardware to send a signal) might still be the only protection for many commercial satellites even today. For example, most communication satellites have very few (if none) protection from "unauthorized access" in data channels - these are dumb relays that send back to Earth anything that is sent up to satellite, so you actually can use someone's else comm sat to transmit your own data. The only downside is that you would need transmitter that would be powerful enough and everyone will soon start searching for source of rogue signal.
Of course many satellites (especially military ones) today are relying on encryption. There's also growing adoption of strong encryption for commercial satellites (CCSDS 352.0-B) and some efforts on standardization of COMSAT interfaces (CCSDS 355.0-B) led by the Consultative Committee for Space Data System. These standards are relatively new (2012-15) and decision to follow these is voluntary, but newer satellites are likely to use those.
Edited: added links to new standards pointed out by David Hammen