Protein involved in the restriction system present in many bacteria and archaea. This defense mechanism is composed principally of a restriction endonuclease and a methylase. The restriction endonuclease cuts the invading DNA of viruses (or phages) at a specific recognition site. The bacterial DNA is protected by the methylase which adds a methyl group to a specific nucleotide, immediately following replication, in the same target site as the restriction enzyme.