Digital signatures vs encryption: which key does what
Choosing the right key for confidentiality or authenticity
How it works
To send something confidential, encrypt it with the recipient's public key; only their private key can decrypt it. To prove you sent something, sign a hash of it with your own private key; anyone can verify with your public key. Real systems combine both: a symmetric key for bulk data, public-key encryption to share it, and a signature for authenticity.
Strengths
- Signatures provide integrity, authentication and non-repudiation.
- Public-key encryption solves key distribution for symmetric keys.
Weaknesses and known attacks
- Mixing up the direction (encrypting with your own private key 'for secrecy') provides no confidentiality, because anyone can decrypt with the public key.
- A signature proves possession of the private key, not the identity behind it, unless a trusted certificate binds the two.
Use it for
- Answering 'which key' exam questions
- Designing hybrid encryption and signing flows
Don't use it for
- Treating a hash on its own as proof of origin (anyone can recompute it)
Exam tip
Confidentiality: recipient's PUBLIC key encrypts. Non-repudiation: sender's PRIVATE key signs. Integrity only: a hash. Integrity with a shared key: HMAC.
References
Go deeper
Glossary: Digital signature
Crypto lab: practise encryption, hashing and signatures
RSA
Public-key encryption and digital signatures
ECDSA
Digital signatures
HMAC
Message authentication (integrity + origin with a shared key)
X.509
Binding public keys to identities
PGP / S/MIME
End-to-end email and file encryption and signing