Analysis of DPA and DEMA Attacks