The act of cleaving DNA or RNA with a restriction enzyme.