Homomorphic Encryption: Compute Without Decrypting
Homomorphic encryption lets you perform computations on data while it's still encrypted. This allows a third party, like a cloud provider, to process your sensitive data without ever seeing the raw information, ensuring privacy.
Why it exists
Many tasks require using a third-party service for computation, like a cloud provider. But how can you let them process your data without giving them access to the sensitive contents? Standard encryption protects data at rest or in transit, but you must decrypt it to compute on it, creating a point of exposure. Homomorphic encryption was designed to solve this problem by allowing computation on data that remains encrypted.
The mental model
Imagine you own a jewelry workshop and a client gives you a locked, transparent box containing raw diamonds. Your task is to cut and polish them. Homomorphic encryption is like having special gloves that let you reach into the box and work on the diamonds without ever unlocking it. You perform the work, and the finished gems remain securely inside the locked box. Only the client, who holds the key, can open it to get the final product.
How it works
The process allows operations on ciphertext that mirror operations on plaintext. First, you encrypt your data using a homomorphic encryption scheme. Second, you send this ciphertext to an untrusted server. Third, the server applies a function—like addition or multiplication—to the encrypted data, producing a new piece of ciphertext that represents the result. When you decrypt this final ciphertext, the output is identical to the result you would have gotten by performing the operations on the original, unencrypted data.
When to use it
Use homomorphic encryption for privacy-preserving outsourced computation. The canonical use case is sending sensitive data (e.g., financial records, health data) to a commercial cloud for analysis or processing. The cloud provider can perform the requested computations without ever having access to the unencrypted information, preserving confidentiality throughout the entire process.
When not to use it
Do not use it when you only need to store or transmit encrypted data without computation. Standard encryption for data-at-rest or data-in-transit is far more efficient. Homomorphic encryption is specifically for the niche, complex problem of computing on ciphertext. If the environment performing the computation is fully trusted, the overhead of homomorphic encryption is unnecessary.
One canonical example
A hospital wants to use a third-party AI service to analyze patient data for disease prediction. To protect patient privacy, the hospital encrypts the health records using a homomorphic scheme and sends the ciphertext to the AI service. The service runs its predictive model on the encrypted data, generating an encrypted risk score. This encrypted result is sent back to the hospital, which is the only party that can decrypt it. The AI service provides its value without ever viewing the sensitive patient records.
Interview question
A healthcare provider wants to analyze patient records using an external AI service without exposing raw data to the service. Which encryption approach is best suited for this task?
- a.Employing SSL/TLS during data transmission to secure the channel between the provider and the AI service.
- b.Using homomorphic encryption, allowing the AI service to compute on the encrypted data directly.Correct
- c.Applying a one-way hash function to sensitive fields before sending, preventing the AI service from seeing original values.
- d.Encrypting data with AES before sending, then decrypting it on the AI service's server for analysis.
Why? this is the answer
Homomorphic encryption is specifically designed for privacy-preserving outsourced computation, enabling operations on data while it remains encrypted, as highlighted in the card's "When to Use It" section. Option D describes standard encryption, which would require the untrusted AI service to decrypt the data, creating a privacy exposure that homomorphic encryption aims to prevent.
Just read this? Test yourself on what you have been reading.
Read the original → en.wikipedia.org
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles