RSA Signature : Process of Sign the message and Verify I have read that the RSA numeric signature works as the following:


Generation of keys : $p,q,N,e,d$
Process of signing the message $m$ (which is BigInteger) : it uses the secret key $sk=(p,q,d)$ so that $s=m^d\bmod N$ where $N=p*q$.
Why do we use the secret key to sign the message?
How I can hash the message ?
Process of verification that uses the public key $pk=(N,e)$ and a couple (message $m$, potential signature $s$), and consists in:  verifying whether the signature is valid (return true) or not (return false).


Can I get more information and explanation here in the verifying process? (I have read somewhere they use encrypt method and others use decrypt method).
We do use the secret key to sign the message as otherwise anybody would be able to sign messages (in your name!)
You can hash a message by passing it to cryptographically secure hash function, like SHA-2/3 and interpret the resulting digest as integer $m$.

The verification (of plain RSA, please note: RSA is never deployed like this) of RSA-signatures works as follows:

Obtain the message $M$ and the signature $s$ and the public key $(N,e)$
Hash the message $M$ to get the &quot;numerical&quot; message $m=h(M)$.
Compute $m'=s^e \bmod N$.
Accept the signature (= return true) if and only if $m=m'$, otherwise reject the signature (= return false)

The third step is the plain RSA-encryption, hence it is sometimes referred to as &quot;encryption&quot;.
The signing equation you cited above corresponds to the decryption operation of RSA public key encryption, therefore to ease understandability for beginners it is often described as &quot;encryption using the private key&quot; or as &quot;decryption&quot;.