Method for performing a cryptographic calculation, which is implemented in a processor device, in a manner protected against attacks, wherein the cryptographic calculation is configured, by applying a cryptographic algorithm to input values comprising a data item and a cryptographic key, to generate a computational result of the cryptographic algorithm, wherein calculations are performed with the key and the complementary key that is complementary to the key; characterized by (a) a calculation measure comprising the following steps: - performing the calculation twice or more times with the data item and the key in order to generate two or more key results (EK1, EK2,...), - performing the calculation twice or more times with the data item and the complementary key (K') in order to generate two or more complementary key results (EK1', EK2',...), (b) also, in order to protect the calculation from safe error attacks, a defensive measure which is in the form of a result comparison measure comprising: - comparing the two or more key results (EK1, EK2,...) for a match with one another, and comparing the two or more complementary key results (EK1', EK2',...) for a match with one another, - if the two or more key results (EK1, EK2,...) and the two or more complementary key results (EK1', EK2',...) match, outputting one or at least one of the key results (EK1, EK2,...) as the result, - otherwise preventing the output of a result and optionally outputting an error code instead of outputting the result. (a) a calculation measure comprising the following steps: - performing the calculation twice or more times with the data item and the key in order to generate two or more key results (EK1, EK2,...), - performing the calculation twice or more times with the data item and the complementary key (K') in order to generate two or more complementary key results (EK1', EK2',...), - performing the calculation twice or more times with the data item and the key in order to generate two or more key results (EK1, EK2,...), - performing the calculation twice or more times with the data item and the complementary key (K') in order to generate two or more complementary key results (EK1', EK2',...), (b) also, in order to protect the calculation from safe error attacks, a defensive measure which is in the form of a result comparison measure comprising: - comparing the two or more key results (EK1, EK2,...) for a match with one another, and comparing the two or more complementary key results (EK1', EK2',...) for a match with one another, - if the two or more key results (EK1, EK2,...) and the two or more complementary key results (EK1', EK2',...) match, outputting one or at least one of the key results (EK1, EK2,...) as the result, - otherwise preventing the output of a result and optionally outputting an error code instead of outputting the result. - comparing the two or more key results (EK1, EK2,...) for a match with one another, and comparing the two or more complementary key results (EK1', EK2',...) for a match with one another, - if the two or more key results (EK1, EK2,...) and the two or more complementary key results (EK1', EK2',...) match, outputting one or at least one of the key results (EK1, EK2,...) as the result, - otherwise preventing the output of a result and optionally outputting an error code instead of outputting the result.