Score:-4

About the public key in Digital Signature

er flag

Please I do have a question as you know to sign a message the sender must first of all calculate the hash of the message and then encrypte it using his private key and then send it to the reciver and then the reciver will use the public key of the sender to decrypte the signateur. so how the reciver got the public key and if the sender send it to the reciver that woudn't be dangeuros the key is known by a hacker for instance

DannyNiu avatar
vu flag
You bold-marked "key of the sender", and missed the adjective "public". By definition, the "public key of the sender" in any secure digital signature scheme can resist attacks that attempts to recover the private key.
Maarten Bodewes avatar
in flag
A few answers have already been given, but in short, yes, it is required to **establish trust** in the receiver and the public key of the receiver. This is a vital part of any public key infrastructure (PKI) such as PKIX using X.509 certificates used by e.g. TLS on most servers. That doesn't mean that the hacker should not have the public key, it's public after all.
Score:3
my flag

as you know to sign a message the sender must first of all calculate the hash of the message and then encrypte it using his private key

Actually, in general, that's not how signature algorithms work. Some can be described that way (if you don't look too closely), but others work entirely differently.

What you can more correctly say is that the signature generation algorithm takes the message and the private key, and produces a signature; the signature verification algorithm takes a message, a putative signature and the public key, and says whether the signature was generated by the message/private key. And (here's the important part for your question) the public key doesn't allow you to do anything else

so how the reciver got the public key

There are a number of ways; the most common is that the sender sends the public key, along with proof that this public key corresponds to the sender's identity; this is essentially what a certificate is.

if the sender send it to the reciver that woudn't be dangeuros the key is known by a hacker for instance

No, it's not dangerous at all - remember the part I emboldened above - the public key allows you to verify signatures, but doesn't allow anything beyond that. Yes, this allow the hacker to also verify signatures - we don't care about that.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.