In public key cryptosystem two keys are used for authentication. There are three different types of application, encryption/decryption, digital signatures and key exchange. In encryption/decryption the sender encrypts the message using a public key and the receiver decrypts it using a private key. In digital signature the sender sends the message with a signature which is been generated using the private key of the sender. Two parties cooperate to generate a common key in the key exchange method. Two widely used algorithms for public key cryptosystem are RSA and Diffie-Hellman.