will be appreciated however that the smart card is exemplary of a variety of different types of portable electronic devices for which the invention is particularly suited and therefore this exemplary description should not be construed as limiting the invention in any manner in the implementation of public key cryptography protocols such as the rsa algorithm for example it is necessary to select a pair of integer numbers p q of given length that are co prime with each other for use in generating electronic keys for the protocol to ensure that the selected numbers are co prime with each other a step of verifying co primeness is performed in the case of a portable electronic device with a microprocessor such as a smart card the test is performed within the card examples of tests for verifying the co primeness are set forth for example in ieee p1363 standard for public key cryptography and in iso iec wd 18032 working draft of apr 18 2001 in practice in the rsa protocol confidentiality of the keys is ensured when the two integer numbers p and q are prime with each other and have a fixed length for example 512 or 1024 bits each typically one of the two numbers q is an integer number that is selected in advance from amongst a set of numbers stored in the microprocessor card the other number p is generated in a random fashion by the microprocessor card when the protocol is to be executed for this purpose the microprocessor card has.