On Wed, 27 Feb 2002, Michael Sierchio wrote: > Erwann ABALEA wrote: > > On Wed, 27 Feb 2002 [EMAIL PROTECTED] wrote: > > > >>I have a quick question about encrypting with private key > > > > That's what we call a signature, and even if it is possible to encrypt > > data with whichever key you want, it's definitely not a good idea to > > *encrypt* with a *private* key, and *decrypt* with a *public* key... > > Well, no -- a signature is a digest and pad encrypted with the private
Yes, you generally privately-encrypt a digest of the data, but it is also possible to sign the data itself. For an example, just look at the PKCS#11 API, you'll find the C_SignRecover() and C_VerifyRecover() functions, which sign the data itself (it *must* have a reduced size, though). Mathematically speaking, you perform the very same exponentiation when you sign, encrypt, decrypt, and verify. What you process doesn't count. > key. There are certainly uses for encrypting a symmetric key with > an RSA private key -- ever heard of S/MIME? PEM? S/MIME encrypts a symetric key with a private key? Are you sure this operation is performed to protect the symetric key from someone else to get it? I don't think so. > I might want to convey a key K to you as > > e-you(d-me(K)) Here you sign K, and encrypt the result with my public key. The signature is not an exponentiation of the digest of the key, it's an exponentiation of the key itself. That's a sign-with-recover operation, and it's a signature operation. In this case, the protection of the symetric key against eavesdroping is not done by the private key operation, but by the public key one. As usual. -- Erwann ABALEA <[EMAIL PROTECTED]> - RSA PGP Key ID: 0x2D0EABD5 ----- It takes months to find a customer, but only seconds to lose one... The good news is that we should run out of them in no time. Demotivators, 2001 calendar ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]