Molecular dynamics (MD) simulations are used to study surface reaction dynamics during dry etching processes of Si and SiO2 surfaces. First simulation results of Si and SiO2 etching by Cl and F beams are presented. In these processes Si is selectively etched over SiO2, the mechanism of which can be easily understood from the observation of surface conditions obtained from MD simulations. We also discuss the difference between beam etching and plasma etching (where a large number of low-energy charge-neutral reactive species exist) for these processes. Secondly we present simulation results of SiO2 etching by CxFy. Thirdly enhanced surface diffusion effects by relatively low-energy ion bombardment (the energy of which is below etching threshold) are presented. To perform these MD simulations, we have developed classical interatomic potential functions using potential energy data obtained from ab initio calculations of electronic states for various molecules and radicals. To model Si and SiO2 etching by halogens, we have constructed Stillinger-Weber type potentials for Si-O-Cl and Si-O-F systems. The potential functions for SiO2 and Si etching by CxFy, are of hybrid type of Stillinger-Weber type functions and Abell-Tersoff-Brenner type functions. The details of these potential functions are also discussed in the presentation.