@zareen said in CS315 Assignment 2 Solution and Discussion:
b) Number of keys being used for cryptography.
Although symmetric key cryptography makes use of only one key, asymmetric key cryptography, also known as public key cryptography, utilizes two keys: a public key and a private key. The public key is used to encrypt data sent from the sender to the receiver and is shared with everyone.
Public and Private Key Concept in Encryption
Secret key cryptography (symmetrical encryption): Both the sender and receiver must use the same key to encrypt and decrypt messages being sent. This imposes a security risk as we need to deliver the key to the recipient of the message in a secure way to make him/her able to decrypt the message. If an intruder gets hold of the key somehow, he/she will be able to decrypt the secret message and thus compromise the whole operation.
Public key cryptography (asymmetrical encryption): In this method we use two keys, one for encryption and the second for decryption. A user will use his/her friend’s public key to encrypt the message. The receiver will use a private key (which should be kept secret) in order to decrypt this message when needed. The public key is used to encrypt plain text or to verify a digital signature, whereas the private key is used to decrypt cipher text or to create a digital signature. Messages encrypted with the public key can only be decrypted using the associated private key pair.