Rajesh,
Using either PGP or GPG you can create a key pair. Basically the decrypter is the one in charge of the key creation. You keep the private one on your keyring and send the public one to the other party. They use the public key to encrypt the file and you use the private key to decrypt the file.
>Is there any classlib to generate a public & private key.