What is the difference between symmetric and asymmetric encryption, and where is each used?
Symmetric encryption uses one shared key for both encryption and decryption. AES is the standard, typically AES-256. It is fast — suitable for bulk data — but creates a key distribution problem: how do you get the key to the other party securely?
Asymmetric encryption uses a mathematically related key pair. What the public key encrypts, only the private key decrypts, and vice versa. RSA and elliptic curve are the common algorithms. It solves key distribution — you can publish the public key freely — but is orders of magnitude slower, so it is impractical for large volumes.
In practice they are used together. TLS is the standard example: asymmetric cryptography authenticates the server and establishes a shared secret, then a fast symmetric cipher encrypts the actual traffic for the rest of the session. Asymmetric for key exchange, symmetric for bulk data.
Other uses: asymmetric keys also provide digital signatures — signing with the private key lets anyone verify with the public key, giving integrity and non-repudiation.
Note: Hashing is a third category and is frequently confused with encryption. A hash is one-way — SHA-256 produces a fixed-length digest that cannot be reversed. Passwords should be hashed, not encrypted, using a deliberately slow algorithm such as bcrypt or Argon2 with a unique salt per password. Saying "we encrypt passwords" in an interview is a serious mistake.





