> Hi all
>
[quoted text clipped - 4 lines]
>
> tia!
Have you a public key certificate?
If you do, provide it to a friend who can import it into an e-mail client
like outlook, outlook express, mozilla, thunderbird. When sending you
e-mail, have him use that certificate to encrypt mail to you.
Import your private key into your e-mail program and specify that key as the
decryption/signing key.
Your e-mail program will do the work of decryption.
Alternatively, get pgp encryption/decryption and import your keys into it.
Incidentally, you can get freemail certificates and private key from Thawte
(www.thawte.com) [ look for freemail] for free.
Ed
Rogue Chameleon - 24 Sep 2004 13:20 GMT
> Have you a public key certificate?
>
[quoted text clipped - 10 lines]
> (www.thawte.com) [ look for freemail] for free.
> Ed
I think I may have mislead you with my question. Allow me to be a little
more detailed in what it is I am trying to do.
From a web server, I will be creating text based reports that need to be
sent to a customer. The data in these reports is sensitive and needs to be
encrypted before being emailed out. What I plan on doing is using a Public
Key (from java.security) to encrypt the file, and using a Private Key (from
java.security) to decrypt the file.
Now, what I've accomplished so far is the creation of the two keys. What I
am trying to figure out is how to encrypt and decrypt the file within the
JCA.
Rogue Chameleon
Edward A. Feustel - 25 Sep 2004 12:24 GMT
>> Have you a public key certificate?
>>
[quoted text clipped - 32 lines]
>
> Rogue Chameleon
Sorry,
I am not that familiar with the JCA.
I think I might take an alternative route IF I had control of the Web Server
and it was running
Mod-SSL Apache for example. I would insist that the client had a Public Key
certificate from
a reliable source known to most browsers. I would get a Public Key
certificate from a reliable source known to most browsers. Then I would set
up SSL for mutual authentication and encryption.
See a book such as Professional Apache for details.
What ever was sent over the SSL channel would be encrypted in both
directions with automatic encryption and decryption as well as certificate
handling taking place in the browser/server.
The Server can also go through an Authorization step so that only the
clients you wish can have
access to specific file(s). This system is easily generalizable to many
clients and providers who have minimal experience with
encryption/decryption.
If your server system is physically secure you should have no problems with
confidentiality.
Hope this helps.
Ed
Hi What you need is an Certificate for your
public key. And than do someting like this
to initialize your Cipher.
X509Certificate cert = ...
Cipher rsaCipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
rsaCipher.init(Cipher.ENCRYPT_MODE, cert);
With that Cipher you can create an CipherIn- or OutputStream.
At the Decryption site of your application you can
initilize your Cihper with the Private-Key.
You should store the private key in an password encrypted
Keystore (ex. JDKPKCS12KeyStore from BouncyCastle)
Hope it helps
But you should think about symetric encryption.
Create a symetric key, encrypt message with "symkey" and
encrypt the "symkey" with the public key and send both
encrypted message and encrypted "symkey".
On the other side decrypt "symkey" and with that decrypted
"symkey" decrypt the message.
If you must ensure that the message comes from the server
you should sign something: either the symkey before encryption
or the complete messagebundle(encrypted message,encrypted key).
Hope it helps even though my bad english
Kind regards.
Sebastian
> Hi all
>
[quoted text clipped - 3 lines]
>
> tia!