I have just learned Digital Signature and am trying to ensure that I have got my understanding of Digital Signature on the correct track.
Assume Alice wants to send a message (M) to Bob where the message is confidential , non-repudiation , integrity.
Alice has the public key ( Apub)
Alice has the private key (Apri)
Bob has the public key (Bpub)
Bob has the private key (Bpri)
The Hash Algorithm used is SHA-1
1) Alice will use Bob public key (Bpub) to encrypt Message (M) to get CipherMessage (CM)
2) Alice will sign on the Message(M) by hashing the Message(M) and encrypting it with her private key (Apri) to get Signature (s)
3) Alice will send CipherMessage (CM) & Signature (S) to Bob
4) Bob will use his private key (Bpub) to decrypt the CipherMessage (CM ) to get back Message ( M )
5) Bob will use Alice Public key (Apub) to decrypt the Signature to get the Hash Message (HM)
6) Bob will hash the Message (M) to get Hash Message (HM)
7) Bob will compare the two values of HM , if they are identical , Bob can be assured of confidentiality , message integrity and non-repudiation.
I am wondering if this is how digital signatures work in general ???