Study of formation, stabilization and properties of porous silicon and porous silica