We present a novel approach to silicon nanomachining, based on the electrochemical etching of the material through a nanopatterned mask.Combining a porous silicon (PS) buffer layer with cross-linked poly(methyl methacrylate) (PMMA) we have obtained masks which show high resistance to the electrochemical etching. PMMA is normally dissolved in a HF/EtOH mixture, but it becomes resistant to such a solution after cross-linking of the polymer. This can be achieved by high-dose electron irradiation in a Scanning Electron Microscope (SEM), obtaining a mask for the subsequent etching. Anyway, due to the strong electric field across the masking layer during the electrochemical process, time duration of such a mask is limited. We demonstrate that the presence of a highly porous silicon thin film lying under the resist leads to an evident improvement of the masking power. A final PS removal leads to the formation of silicon micro- and nanostructures in relief, such as microtips and nanomolds. Thus, we have at hand a simple silicon nanomachining process, where the nanofeatures written by the electron beam in the SEM are transferred to the bulk material through a short anodization step in acid solution. This may be a useful alternative method for fabricating nanodevice elements, such as nanofluidic channels or field emitter arrays.