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 7834445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:09:26+00:00 2026-06-02T13:09:26+00:00

Searching for how signing is done I’ve come across some fairly elaborate code samples.

  • 0

Searching for how signing is done I’ve come across some fairly elaborate code samples. But the following code seems to be enough. Is there something missing here like a salt for example, or are salts unnecessary when just signing? I’m not encrypting, just signing.

RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();

byte[] data = Encoding.ASCII.GetBytes("hello");
byte[] signature = rsa.SignData(data, "SHA1");

byte[] dataTest = Encoding.ASCII.GetBytes("hello");
bool verified = rsa.VerifyData(dataTest, "SHA1", signature);
if (verified) Text = "True"; else Text = "Untrue";
  • 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-02T13:09:28+00:00Added an answer on June 2, 2026 at 1:09 pm

    Are salts unnecessary when just signing?

    Salting is necessary if your task is to prevent precomputation of hashes of known messages where the hash is being used as a shared secret. If that’s not your application then there is no need to salt.

    If you do not understand why you need a salt, see my series of articles on that topic:

    http://blogs.msdn.com/b/ericlippert/archive/tags/salt/

    Is there something missing here?

    Yes, the most important step is missing. How are you going to communicate the public key? The security of the whole system relies upon that step, which you have not even mentioned.

    Suppose Alice wishes to send a message to Bob and Bob wishes to verify that it came from Alice. They do the following:

    • Alice creates a key pair and securely stores the private key.
    • Alice publishes the public key.
    • Bob obtains Alice’s public key.
    • Alice publishes a message.
    • Alice hashes the message and encrypts the hash with her private key.
    • Bob reads the message.
    • Bob reads the encrypted hash.
    • Bob decrypts the encrypted hash with Alice’s public key.
    • Bob hashes the message.
    • Bob compares the decrypted hash to the message hash. If they match, then Bob knows that the message was vouched for by Alice.

    Is this correct?

    No. The conclusion is incorrect. The conclusion should be:

    • Bob compares the decrypted hash to the message hash. If they match, then Bob knows that the message was vouched for by someone who possessed the private key that matches the public key that Bob believes is Alice’s public key.

    The original conclusion is only correct if Bob has additional evidence that he has Alice’s public key. Because Bob could be in this situation:

    • Alice creates a key pair and securely stores the private key.
    • Mallory creates a key pair and security stores the private key.
    • Alice publishes the public key.
    • Mallory intercepts Alice’s publication and replaces Alice’s public key with Mallory’s public key.
    • Bob obtains Mallory’s public key but believes it is Alice’s.

    And now the whole thing has gone to hell. Mallory can now publish messages that Bob believes come from Alice, and Alice cannot!

    You have to say how you are going to securely publish the public key. The entire system relies on two things: that the private keys stay private, and that there is some mechanism by which public keys can be correctly associated with their owners.

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

Sidebar

Related Questions

Searching for an answer, some had noted the issue but no one resolved it.
Searching for a way to add this code, after the <head> (or some <link
While searching for the solution, I've come across various links which talk about reading
Searching turns up a simple definition: data hiding. But, consider the following two examples:
Searching for some sample code for converting a point in WGS84 coordinate system to
Searching here I found that this question was already asked , but I think
Searching online, I have found the following routine for calculating the sign of a
Searching for a while now, but haven't found a suitable answer to my problem.
Searching since yesterday, but I only get adance method. I use spring with tomcat
Searching in the second value of a map i use somthing like the following:

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.