We investigate the composition and shape distribution of silicate dust grains in the interstellar medium . The effects of the amount of magnesium and iron in the silicate lattice are studied in detail . We fit the spectral shape of the interstellar 10 \mu m extinction feature as observed towards the galactic center using various particle shapes and dust materials . We use very irregularly shaped coated and non-coated porous Gaussian Random Field particles as well as a statistical approach to model shape effects . For the dust materials we use amorphous and crystalline silicates with various composition as well as silicon carbide ( SiC ) . The results of our analysis of the 10 \mu m feature are used to compute the shape of the 20 \mu m silicate feature and to compare this with observations of this feature towards the galactic center . By using realistic particle shapes to fit the interstellar extinction spectrum we are , for the first time , able to derive the magnesium fraction in interstellar silicates . We find that the interstellar silicates are highly magnesium rich ( \mathrm { Mg / ( Fe + Mg ) } > 0.9 ) and that the stoichiometry lies between pyroxene and olivine type silicates ( \mathrm { O / Si } \approx 3.5 ) . This composition is not consistent with that of the glassy material found in GEMS in interplanetary dust particles indicating that the amorphous silicates found in the Solar system are , in general , not unprocessed remnants from the interstellar medium . Also , we find that a significant fraction of silicon carbide ( \sim 3 % ) is present in the interstellar dust grains . We discuss the implications of our results for the formation and evolutionary history of cometary and circumstellar dust . We argue that the fact that crystalline silicates in cometary and circumstellar grains are almost purely magnesium silicates is a natural consequence of our findings that the amorphous silicates from which they were formed were already magnesium rich .