Asymmetric Encryption
1. Asymmetric Encryption
Unlike symmetric encryption (one key), asymmetric encryption uses a Key Pair. These keys are mathematically linked but cannot be derived from one another.
Public Key
Shared with everyone. Used by others to encrypt a message meant for you.
Private Key
Kept strictly secret by the owner. Used to decrypt messages encrypted with your Public Key.
2. Digital Signatures
A Digital Signature proves that a message hasn't been altered and that it definitely came from the sender (Non-repudiation).
- Sender creates a Hash of the message.
- Sender encrypts the hash using their Private Key.
- The message and the encrypted hash (the signature) are sent.
- Receiver decrypts the hash using the sender's Public Key and compares it to their own hash of the message.
3. Digital Certificates
How do you know a Public Key actually belongs to the person who claims it? You use a Digital Certificate issued by a Certificate Authority (CA).
- Contains the owner's Name, Serial Number, Expiry Date, and Public Key.
- Contains the Digital Signature of the CA to prove the certificate is valid.
4. SSL / TLS Handshake
This is what happens when you visit https://e-consult.co.ke:
- Browser requests a secure connection.
- Server sends its Digital Certificate (containing its Public Key).
- Browser verifies the certificate with a CA.
- Browser generates a random Session Key (symmetric), encrypts it with the server's Public Key, and sends it back.
- Server decrypts it with its Private Key. Both now use the Session Key for fast, encrypted communication.
In your SaaS voting system, every voter has a "Wallet Address," which is essentially a derived version of their Public Key. When they cast a vote, they sign the transaction with their Private Key. This proves the vote is authentic without revealing who they are!