Re: What is exponent?



Did you look at the classes for SignedData and EnvelopedData in the Pkcs
namespace? I'd suggest using those for doing encryption and signing of
messages as they take care of all of the housekeeping details for handling
the symmetric keys and hashing while using the PKCS#7 standard for building
the messages so that you'll have interoperability with other systems that
can read PKCS#7 messages (SMIME, etc.).

It is totally possible to build up your own system for doing this stuff, but
it is not that easy and only your code will be able to read it. It is also
pretty difficult building your own PKCS#7 messages from scratch, especially
without a low level managed code ASN.1 library to lean on (which the .NET
framework does not have built in, although there are add-ons you can get
that do).

There are good Wikipedia references on all the PKCS stuff if you want to
read up on that more. :)

Joe K.

--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"olduncleamos" <olduncleamos@xxxxxxxxx> wrote in message
news:cd60ca46-78b9-4ae2-a3b7-588c965645f9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 25, 8:30 am, Valery Pryamikov <valery.pryami...@xxxxxxxxxx>
wrote:
On Dec 25, 4:38 am, olduncleamos <oldunclea...@xxxxxxxxx> wrote:



Can somebody help explain this?

RSA algorithm involves modulus, which is a product of two primes of
the same order that are usually called P and Q. Two exponents, one
private and one public that are usually called d and e and related to
each other by being multiplicative inverse to each other mod
(P-1)*(Q-1).

For simple description of RSA algorithm
checkhttp://en.wikipedia.org/wiki/RSA

From asymmetric algorithms RSA is one of the simpliest. Other
asymmetric algorithm use different components/parameters of public and
private key. You can find simple description of many algorithms on
wikipedia.

-Valery.

Thank you for the wikipedia article. It certainly helped me understand
the concept better.

However, I am more interested in the practical coding in .Net terms.
Specifically there are two routines that I am trying to code:

Given that I represent the sender, thus in possession of the sender's
certificate. I also have the receiver's certificate (public key only).
I need the routines to:
1) Use RSA to encrypt the session key (using receiver's public key)
and
2) Use SHA1 to calculate the cipher text's hash value and then use RSA
to encrypt the message digest (using my private key).

I assume this is the most common scenario that eveybody does. I am
just unsure the function call and libraries that I need to use. I
would love to see some code sample that does exactly the above.

Thanks again for your help.


.



Relevant Pages

  • Re: RSA Encrypt/Decrypt Problems
    ... You can generate a snk for each and replicate the public key part to each ... Then sym encrypt your data with the key and iv and store in the ... You could actually do it with small blocks and only the public rsa key, ... > key) with the symmetric key embedded in the file and encrypted using the ...
    (microsoft.public.dotnet.security)
  • Re: how to create a file with copy/read denied to it
    ... This refers to RSA. ... She then encrypts the message digest with her private key, ... decrypts the signature with Alice's public key to recover the ... RSA decryption algorithm is used to *encrypt* the plaintext and vice ...
    (comp.unix.programmer)
  • Re: RSA - Public vs. Private Keys
    ... RSA is intended to encrypt messages with public keys only. ... encrypt the symmetric key with the private key. ... and public key/certifcate info about the public key ...
    (microsoft.public.dotnet.security)
  • Re: Encryption
    ... RSA is used extensively by CF WSE. ... -i verify a message from them with their public key. ... -i encrypt a message to them with their public key. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: What is exponent?
    ... private and one public that are usually called d and e and related to ... For simple description of RSA algorithm checkhttp://en.wikipedia.org/wiki/RSA ... I also have the receiver's certificate (public key only). ...
    (microsoft.public.dotnet.security)