I have no idea about signing/encrypting the data. Could anyone please tell me what exactly is it and How to achieve this?
Although, you do use encryption for signing, technically, when you are signing data, you are not protecting it... but a little backgroud.
Encryption is the technique to take the data and convert it to a form which can't be used. This new form needs to be decrypted before it can be used (or even understood). Encryption techniques uses a key to encrypt and decypt. The keys can be symmetic or asymmetric. (asymmetric is used here, so let's only discuss that)
Asymmetic keys means that the keys used to decrypt is not the same key that is used to encrypt. If one of the keys is used to encrypt, the other key is used to decypt -- interestingly any key is used to encrypt or decrypt. These keys are generated in pairs and with one key, you can't figure out the other key (another interesting property).
Anyway, one of the two keys is chosen as the public key and given to everyone. The other key is the private key, and is given to no one.
So,... How does a service use it to sign data? To sign data, the service simply needs to encrypt the data with the private key (sometimes some extra data is also added before encrypt). This doesn't protect the data -- since anyone can get the public key and decrypt it.
However, this data is signed -- why? Because only the service can use the private key. If you take the signed data, decrypt it with the public key, and the data is valid (likely using the extra data), you can conclude that it was signed (encrypted) by the service, since only the service has the private key.
Henry