Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7987367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:07:39+00:00 2026-06-04T12:07:39+00:00

I have Found following Code Sample on MSDN when i was searching for RSACypthyServiceProvider.I

  • 0

I have Found following Code Sample on MSDN when i was searching for RSACypthyServiceProvider.I couldn’t understand some part of thecode with the help of comment.

  1. What is modulus and Exponent ?

  2. What is IV?

  3. Why they are using RijndaelManagedclass to do asymmetric encryption? Based on my search RSACryptoServiceProvider provides Asymmetric encryption functionality and it will automatically creates Private and Public key when we create the object .So What is the Purpose of RijndaelManaged instance here?

Can any one please explain?

Code Sample:

class Class1
{

   static void Main()
   {

     //Initialize the byte arrays to the public key information.
      byte[] PublicKey = {Somethink in byte}

      byte[] Exponent = {1,0,1};

      //Create values to store encrypted symmetric keys.
      byte[] EncryptedSymmetricKey;
      byte[] EncryptedSymmetricIV;

      //Create a new instance of the RSACryptoServiceProvider class.
      RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();

      //Create a new instance of the RSAParameters structure.
      RSAParameters RSAKeyInfo = new RSAParameters();

      //Set RSAKeyInfo to the public key values. 
      RSAKeyInfo.Modulus = PublicKey;
      RSAKeyInfo.Exponent = Exponent;

      //Import key parameters into RSA.
      RSA.ImportParameters(RSAKeyInfo);

      //Create a new instance of the RijndaelManaged class.
      RijndaelManaged RM = new RijndaelManaged();

      //Encrypt the symmetric key and IV.
      EncryptedSymmetricKey = RSA.Encrypt(RM.Key, false);
      EncryptedSymmetricIV = RSA.Encrypt(RM.IV, false);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:07:40+00:00Added an answer on June 4, 2026 at 12:07 pm

    RSA is very slow, and has overhead for padding. So it’s common to generate a random symmetric key, encrypt it with RSA, and encrypt the message with the symmetric key. This approach is known as hybrid cryptosystem.

    IVs are important if a single key is used to encrypt multiple messages, but since this code creates a new key for each message, the IV isn’t really important here. Still using an IV can prevent multi-target attacks, so it’s not completely useless with unique keys, especially if the key only has 128 bits.

    This code is pretty inefficient too: It encrypts IV and key separately, instead of concatenating them. This doubles the RSA overhead.

    Modulus and exponent are the two parts of an RSA public key. Look up wikipedia for details. The exponent is often chosen to be 2^16 + 1 = 65537, which corresponds to the {1,0,1} in this code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found some sample code on codeproject that allows for user impersonation. This
On the MSDN, I have found following: public event EventHandler<MyEventArgs> SampleEvent; public void DemoEvent(string
Searching online, I have found the following routine for calculating the sign of a
I have following sample code. Initially, only commandButton Two is visible. When I click
I'm currently trying to adapt some sample code and have hit a snag when
Morning All, I was hoping someone could help or provide some sample code for
I have found the following command in AWK useful in Vim :'<,'>!awk '{ print
I have found the following expression which is intended to modify the id of
I have found the following resources on Balanced Matching for .net Regexes: http://weblogs.asp.net/whaggard/archive/2005/02/20/377025.aspx http://blogs.msdn.com/bclteam/archive/2005/03/15/396452.aspx
Reading a book I have found the following statement: (Object) Behaviors answer either of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.