← Microsoft Interview Insights
I knew this one cold but somehow started rambling about SHA-256 before actually defining either term.
Start by defining encryption and hashing clearly, emphasizing their core purposes: encryption is for confidentiality (reversible with a key), while hashing is for integrity (one-way). Then contrast them across dimensions like reversibility, use cases, and security properties, and tie it back to practical scenarios in system design.
Pro tip: Mention that encryption alone doesn't guarantee integrity—you often need a MAC or digital signature—and that hashing with salt is crucial for password storage to prevent rainbow table attacks. This shows depth beyond textbook definitions.
Explain that encryption transforms plaintext into ciphertext using an algorithm and a key, and it is reversible (decryption) to recover the original data. Its primary goal is confidentiality.
Explain that hashing converts input data into a fixed-size digest using a one-way function, and it is not reversible. Its primary goals are integrity verification and fast lookup.
Highlight reversibility (encryption is reversible, hashing is not), key usage (encryption uses keys, hashing typically doesn't), output size (encryption output size varies, hashing output is fixed), and purpose (confidentiality vs. integrity).
Give examples: encryption for secure communication (HTTPS, VPNs), hashing for password storage (with salt), data integrity checks, and digital signatures.
Clarify that encryption does not provide integrity by itself, and that hashing is not encryption. Mention that hashing can be used with encryption (e.g., HMAC) for authenticated encryption.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.