Hi

Is there any way I can use a pair of keys(private-public key pair) generated externally for encryption/decryption of files rather than generating a pair of keys for every cycle of encryption/decryption ??

My program requirement is that I need to run an encryption program packaged in a jar file. The decryption can happen at any arbitrary time which should not be dependent on a key. I do not store the key seperately. I wish to hard code the keys in my encryption class so that the same pair of keys(private-public) is used each time.

Any illustrations / ideas on the same?

I'm a bit confused by this. You seem to be wanting to give people an encrypted file and a decrypter with the key already filled in. Why bother encrypting in the first place?
But if that's what you want - just store your keys somewhere - eg a file that's included in your jar, or even in the source code.

Exactly, I want to know how we can store the Key objects generated once, for further use.

thanks james..that was of great help !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.