How encryption protects information, how symmetric and asymmetric keys differ, and how signatures and certificates fit in.
What is encryption?
Encryption transforms readable information, called plaintext, into ciphertext using an algorithm and a key. Decryption uses the appropriate key to recover the plaintext.
The purpose is confidentiality: someone who obtains the ciphertext should not be able to read the original information without the required secret.
Think of sending a letter in a locked box. The box may pass through many hands, but only someone with the right key can open it. The analogy explains access; real encryption works on data through mathematics.
What is an encryption key?
A key is a value that controls a cryptographic operation. The algorithm can be public while the necessary key remains secret. Security should depend on protecting keys and using a sound scheme correctly.
A password is not usually used directly as an encryption key. Software can derive a key from it using a password-based key derivation function. A weak password can still be guessed, even when the underlying cipher is strong.
What is symmetric encryption?
Symmetric encryption uses the same secret key to encrypt and decrypt. Both sides must protect that secret.
For example, two people sharing an encrypted archive need access to its secret key. Sending the key alongside the archive through the same exposed channel defeats the protection.
Symmetric encryption is efficient for large amounts of data. AES is a widely used symmetric cipher. A complete encryption scheme also specifies how the cipher is used and how related values are managed.
What is asymmetric encryption?
Asymmetric, or public-key, encryption uses a related pair of keys: a public key that can be shared and a private key that must remain secret.
Suppose Alice wants to send Bob a confidential message:
- Bob generates a suitable key pair and keeps his private key secret.
- Alice obtains Bob's public key and checks that it really belongs to him.
- Alice encrypts using that public key through a suitable encryption scheme.
- Bob decrypts using his private key.
Sharing the public key does not enable someone to derive the private key feasibly when the scheme and key sizes are secure.
The identity check matters. If an attacker substitutes their public key, Alice may encrypt a message that the attacker can read. A trusted fingerprint or a digital certificate can help authenticate a key.
RSA can be used in encryption schemes such as RSA-OAEP. Other public-key algorithms serve different purposes: some establish shared secrets, while others create signatures. A public/private key pair is not automatically suitable for every operation.
How does the box example work?
Imagine Bob wants Alice to send him a private letter in a box.
With a shared secret key, Alice locks the box and Bob opens it with a copy of the same key. They must first arrange to share that key safely. Anyone who gets a copy can open the box.
For a public/private key pair, imagine a special box lock with two different keys. Bob gives everyone copies of the key that can only lock it, while keeping the key that can only unlock it.
Alice puts her letter in the box and uses Bob's public locking key. She cannot use that key to unlock the box again. Bob uses his private unlocking key to read the letter.
The public locking key represents the public encryption key, and the private unlocking key represents the private decryption key. This is an imagined lock with two different capabilities, not how an ordinary door lock works. Real encryption performs those operations on data mathematically.
Alice must check that the public key really belongs to Bob before using it. A key supplied by an attacker would protect the message for the attacker instead.
Why use both kinds together?
Many systems combine public-key cryptography with symmetric encryption.
Public-key methods establish or protect a shared secret, and symmetric encryption handles the bulk data. This avoids requiring people to share a secret beforehand while retaining efficient data protection.
In a typical certificate-based TLS 1.3 connection, the server authenticates with a certificate and signature, the parties establish shared secrets through key agreement, and symmetric authenticated encryption protects their traffic. Key agreement is a way to derive shared secrets, rather than simply sending the conversation encrypted with a certificate's public key.
Is signing the same as encryption?
No. Encryption protects confidentiality. A digital signature lets others check that data was signed with a particular private key and has not changed.
For signatures, the signer uses a private signing key and the verifier uses the corresponding public key. Signing is a distinct operation, not a general instruction to “encrypt with the private key”.
A signed qualification on an NFC tag can remain readable to everyone. Its signature protects authenticity and integrity, not secrecy. Encrypting it would address a separate question: who may read the qualification?
How is a document's hash signed?
Think of a qualification sheet with a small fingerprint slip attached. A cryptographic hash produces that fingerprint, called a digest, from the exact document data. In a hash-and-sign scheme, the issuer signs the digest with its private key and sends the document together with the resulting signature.
For this RSA PKCS#1 v1.5 example, the verifier uses the public key to recover the signed digest and independently calculates a fresh hash of the received document. The two hashes must match exactly. If the document changes, its fresh hash no longer matches the signed digest and verification fails.
For example, changing “Result: Passed” to “Result: Failed” changes the document's digest. The signature made for the original digest will fail verification against the altered document. An attacker can calculate a new hash, but cannot create a valid replacement signature without the private key, assuming the scheme remains secure.
Does RSA verification compare the hashes exactly?
Yes. In this RSA PKCS#1 v1.5 example, verification requires an exact match between the recovered digest and the freshly calculated hash. The document itself remains readable; the signature authenticates its digest. Other signature schemes perform their checks differently.
The qualification can remain fully readable. The signature detects alteration rather than preventing someone from editing or copying the data. Software normally performs the hashing inside its signing and verification functions; do not add an extra hashing step unless the API requires it.
How do hashing and encoding differ?
- Encoding changes representation so data can be stored or transmitted. Base64 is reversible without a secret and provides no confidentiality.
- Hashing produces a digest of data. A cryptographic hash is designed to resist recovering an input from its digest and finding collisions. It is not reversible encryption; predictable inputs can still be guessed and checked.
- Encryption is designed to be reversed with the appropriate key.
A hash alone does not authenticate a message: an attacker who can replace the message may also replace its hash.
Does encryption detect tampering?
Encryption alone does not necessarily detect changes. Authenticated encryption combines confidentiality with a check that rejects altered protected data. Examples include AES-GCM and ChaCha20-Poly1305.
Such schemes also require correct handling of values such as nonces. Reusing a nonce where uniqueness is required can break security. Use maintained cryptographic libraries and established protocols that manage these requirements.
What can encryption not protect?
Encryption cannot stop a recipient from copying decrypted information. It cannot protect plaintext already exposed by an infected device, a screenshot or a stolen unlocked session.
It may also leave metadata visible, such as who is communicating, when and approximately how much data is sent. Transport encryption protects a connection; end-to-end encryption aims to keep message contents readable only at the communicating endpoints.
If the necessary decryption key is lost and there is no recovery mechanism, the data may be unrecoverable. Key storage, backup and access control are therefore part of the design.
Encryption is useful wherever information must remain private, but its protection depends on the whole system: the scheme, the keys, the devices and the people allowed to read the result.
References
The distinction between signing and secrecy also draws on my earlier NFC document-authentication notes.
Ai disclosure: written with the help of AI (ChatGPT). You are encouraged to point out errors and omissions.






