These messages are secret. However, B cannot be sure that A has sent the messages because anyone could have used B , B 's public key. Thus messages are not authenticated. For authentication we need to assume that a user's decryption key can be used to encrypt cleartext that can be decrypted by his encryption key. A encrypt its messages to B using A 's secret key A .
B can decrypt the messages by using A 's public key A .
Thus we have both secrecy and authentication. Encryption and decryption algorithms that can be used in public-key systems are too complex to be discussed here. The encryption and decryption algorithms are such that the difficulty of finding a key is equal to solving the problem and the difficulty of encryption and decryption is equivalent to recognizing a solution to the problem. An example of such a problem is factoring the product of two very large prime numbers.