Countermeasures against attacks on cryptographic mechanisms