Yes, but it would be more normal to encrypt a symmetric key using the
recipients public key and send the data encrypted under the symmetric key
and the encrypted symmetric key to the recipient who could then decrypt
(using their private key) the symmetric key and then decrypt the data.

The reason is that RSA is VERY slow by comparison with symmetric algorithms,
so only encrypt the minimum you need to with the RSA key.

Dave

-----Original Message-----
From: Ludwig Seitz [mailto:[EMAIL PROTECTED]
Sent: 06 April 2004 11:18
To: [EMAIL PROTECTED]
Subject: Re: RSA Public Key Encryption


Quoting MrWebLover <[EMAIL PROTECTED]>:

...
> I want to encrypt sensible Data with the Public key encryption so, that,
> the destination application it can be decrypt, but NOT encrypt.
>
> During my study, i have lerned, the follows for PKE :
>
> Bob and Allice have both an Pup/Priv Keyset.
> Everyone keeps the private key for itself and gives the pup key to the
> other.
>
> - Now, when Bob encrypt anything with his private key, everyone can
decrypt
> it
>   with the public key from bob.
> - If bob want to encrypt sensible data for itself, then, he encrypt the
data
> with his
>   puplic key, and so only his can decrypt it, wis his private key.
>
> This is, what i need. I want to entcrypt data with a privatekey so, that
only
> the public key, can
> decrypt it. And it is importently that the private key is not generateable
> from the public key !
> The public key must be in my application, so that can decrypt the file.
>
> Is there any way to do this, in this case, with the crypto++ Library ?
>
> I only found the PKE encryption with a public key, and the decryption with
> the private key.
> And i read messages in this list, that the public key is regenarate
> (contained) in the private key.
>
Shooting from the hip I would say: Just inverse the public and the private
key.
Use the public key in your application to decrypt and the private key
elsewhere
to encrypt the data.

Use the RSAEncryptString(const char *pubFilename, const char *seed, const
char
*message) example from
http://cryptopp.sourceforge.net/docs/ref/test_cpp-source.html and put the
filename of the private key into char *pubFilename.

Hope it helps,

Ludwig Seitz





Reply via email to