Encryption (WIP)
Encryption is the process of converting data into an unreadable format to ensure confidentiality. Its crucial center is that it relies on cryptographic algorithms and one or more keys to protect information from unauthorized access.
Unlike encoding, encryption is designed to be reversible only for those who have the correct key, making it essential for secure communication, data protection, and privacy.
A main concept in cryptography is the Key Size, which refers to the number of bits used in a cryptographic key. This gives a measure of how many possible different keys there are, and the resistance against brute-force attacks. For example, a 128-bit key has 2128 possible combinations, a 256-bit key has 2256 possible combinations, and so on.
There are two main types of encryption, which have different characteristics and cases of use:
Symmetric
Also called secret-key encryption, uses the same key for both encryption and decryption. Itβs fast, efficient, and ideal for encrypting large volumes of data.
Its main characteristics are:
Used when the priority is speed and efficiency are priority
Usually used to protect files, communications, databases, embedded systems, and secure tunnels in network protocols such as VPNs, TLS, or SSH
Faster than symmetric encryption but with less key size
Both parties need to share the secret key before the communication and keep it secure
Some examples are AES, DES, 3DES, RC4, Blowfish
Asymmetric
Asymmetric encryption uses a pair of keys, the first one known as the public key, to encrypt the information, and the second one as the private key, to decrypt it. The public key can be shared with anyone, but the private key must be kept secret.
It's widely used in secure messaging, digital signatures, and key exchange.
Typically used for secure key exchange and digital signatures
Slower than symmetric encryption, but it is more secure as the private key is never shared with anyone
Some examples are RSA, DSA, ECDH, ECC
Your reversed scenario:
Only you know the public key
Everyone knows the private key
𧨠What happens?
Anyone can decrypt messages meant for you (they have the private key)
Nobody can encrypt a message for you (they donβt have your public key)
π₯ Result: No confidentiality. No one can send you secret messages, and any encrypted data is public.
Signatures
Private to encrypt, public to decrypt. authentication
Your reversed scenario:
Everyone has the private key
Only you have the public key
𧨠What happens?
Anyone can generate a signature pretending to be you
Only you can verify it (but no one else can trust it)
π₯ Result: Signatures are meaningless β anyone can forge them, and no one else can verify them.
Last updated