1. Why compute on encrypted data?

A service may encrypt a file on disk and protect its network connection with TLS, yet still read the file when it performs a calculation. That gap matters when the calculation uses a medical record, a private financial input, or a machine-learning feature vector. The useful question is whether a server can do the work without first seeing the underlying values.

Homomorphic encryption makes certain operations on ciphertexts correspond to operations on their plaintexts. The server receives encrypted inputs and produces an encrypted result. An authorized party with the secret key decrypts that result. The server does not need the secret key to carry out the supported computation. This changes where plaintext must be exposed; it does not remove the need to decide who should learn the output.

Background: Microsoft SEAL’s introduction to homomorphic encryption.

2. The client–evaluator model

Think of an FHE application as three connected stages. First, the client chooses suitable parameters and generates keys. It encodes and encrypts its input. Next, an evaluator applies an agreed computation to those ciphertexts, using public parameters and any required evaluation keys. Finally, the client decrypts and decodes the returned ciphertext.

01 / CLIENTEncode and encryptKeep the secret key with the authorized decryptor.
02 / EVALUATORCompute on ciphertextsUse public parameters and appropriate evaluation keys.
03 / CLIENTDecrypt the resultRecover the answer within the scheme’s correctness or precision guarantees.
Dec(sk, Eval(f, Enc(pk, x))) ≈ f(x)
Conceptual correctness relation. For exact schemes, read this as equality in the plaintext space; for approximate schemes, allow a controlled numerical error. Evaluation may also require evaluation keys, omitted here for readability.

The function f must be expressed in operations the chosen system supports. A familiar program can contain branches, comparisons, divisions, and memory lookups that require substantial redesign. “Fully” describes computational expressiveness under the scheme’s model; it does not promise that every ordinary program becomes efficient when encrypted.

Computation-model background: HomomorphicEncryption.org introduction.

3. A small arithmetic example

Suppose a client needs the weighted score s = 2x + 3y. Let x = 7 and y = 4, so the answer is 26. A suitable arithmetic HE scheme can let the server multiply encrypted inputs by the public constants 2 and 3, add the resulting ciphertexts, and return an encryption of the score. The client then decrypts it.

The arithmetic is simple, but the information flow is different: the evaluator need not receive 7 or 4 as plaintext. If the coefficients are public, the evaluator can often use ciphertext–plaintext multiplication. If the coefficients must also be hidden, the design, keys, and cost may change. That is an application decision rather than an automatic consequence of encrypting the inputs.

Interactive arithmetic illustration
2x + 3y = 26

This is not an FHE implementation. The values above are public and the arithmetic runs in plaintext in your browser. The illustration explains the function; a real system would encode and encrypt the inputs before evaluation. No values are sent to a server.

One output does not necessarily reveal each input, but outputs can still reveal sensitive information. Repeated, deliberately chosen queries can disclose more than an isolated answer. Input confidentiality and permitted output disclosure must therefore be considered separately.

4. Partial, somewhat, leveled, and fully homomorphic

These terms describe different capabilities. Partially homomorphic schemes support a restricted family of operations. Somewhat homomorphic schemes can handle richer computations within limited bounds. Leveled FHE supports circuits up to a depth chosen in advance, with parameters sized accordingly. FHE supports arbitrary polynomial-size circuit evaluation under its formal construction and assumptions.

A practical application with a known, bounded computation may use leveled evaluation without bootstrapping. A longer computation may need a way to refresh ciphertexts. Bootstrapping is central to many constructions and implementations, but it is not a requirement that every application must invoke after every operation.

For the role of circuit depth and leveled evaluation, see Fully Homomorphic Encryption without Bootstrapping.

5. BFV, BGV, CKKS, and TFHE

Choosing a scheme starts with the values and operations your application needs. Exact modular arithmetic, approximate numerical computation, and Boolean or small-integer functions have different cost models. A scheme that is convenient for a packed vector calculation may be awkward for a comparison-heavy program.

A high-level comparison, not a performance ranking.
FamilyComputation modelImportant design question
BFV / BGVExact arithmetic in a modular plaintext spaceCan intermediate values wrap around the plaintext modulus?
CKKSApproximate arithmetic on encoded real/complex vectorsWhat numerical error can the application tolerate?
TFHE / FHEW-styleBoolean gates and small-message operations; programmable bootstrapping can evaluate supported lookup functionsHow should values and functions be represented for the chosen implementation?

With BFV or BGV, “exact” refers to the specified modular space. For example, a computation modulo 17 maps 20 to 3; this is correct modular arithmetic, but may surprise an application expecting ordinary unbounded integers. Bounds on intermediate values matter as much as bounds on the final result.

CKKS instead accepts approximation as part of the numerical model. It is useful when small errors are acceptable, but a near-equality test or threshold decision can become sensitive to error. TFHE-family techniques offer a different route for discrete functions, including programmable bootstrapping. These families are not interchangeable drop-in settings.

Original papers: Fan–Vercauteren, BGV, CKKS, and Chillotti–Gama–Georgieva–Izabachène.

6. Why noisy ciphertexts need careful parameters

Many widely used FHE systems are based on learning-with-errors problems or their ring variants. A deliberately small error is part of the cryptographic construction. A simplified ring-based ciphertext relation can be written as follows:

c₀ + c₁s = Δm + e (mod q)
A schematic relation for intuition, not a complete scheme. Here s is secret-key material, m is an encoded message, e is an error term, and Δ is an encoding scale. Signs, encodings, and representations vary across schemes.

Decryption must separate the intended encoded message from the error. Homomorphic operations change both the message and the error. Multiplication is particularly important because it introduces cross-terms and can increase ciphertext complexity. If the error grows beyond what the parameters and decoding rule permit, correct recovery is no longer guaranteed.

There is no universal rule that “a ciphertext supports exactly this many operations.” The relevant constraints depend on the scheme, modulus choices, circuit structure, precision target, and security parameters. Making a modulus larger to accommodate more work also affects parameter selection; performance and security cannot be tuned independently.

Ciphertext and error intuition: Zama’s ciphertext-type explanation. Parameter guidance: HomomorphicEncryption.org.

7. Multiplicative depth and precision

Depth measures dependency, not simply the number of multiplications. Multiplying eight inputs in a chain takes seven dependent multiplication stages. Pairing them, multiplying the pairs, and then combining the two remaining products takes three stages. Both use seven multiplications, but their depth differs. This is a basic reason that algebraic organization matters in encrypted computation.

Relinearization and rescaling do different jobs

After multiplication, relinearization reduces the ciphertext’s expanded secret-key degree using suitable evaluation keys. It should not be confused with a general noise reset. In CKKS, rescaling reduces the scale and modulus after operations that increase the scale; it also affects numerical precision. Ciphertexts being combined must have compatible parameters and appropriately aligned scales.

For intuition, multiplying values encoded at scale Δ produces a product with scale roughly Δ². Rescaling manages that growth. It does not magically remove all numerical error, and simply changing a scale label is not a substitute for a valid arithmetic plan.

Relinearization: Fan–Vercauteren. Approximate arithmetic: CKKS. A worked scale-management example: Microsoft SEAL’s CKKS example.

8. Packing, rotations, and data layout

A ciphertext does not always correspond to one application value. Supported encodings can pack many values into slots, so one homomorphic addition or multiplication operates across a whole vector. This SIMD-style organization can make a substantial difference to throughput. The available layout depends on the scheme and its parameters.

Enc([a₀, a₁, …]) ⊙ Enc([b₀, b₁, …])
→ Enc([a₀b₀, a₁b₁, …])
Conceptual slotwise multiplication under a compatible packed encoding.

Slotwise multiplication alone does not compute a dot product: the products must also be summed across slots. Rotations and additions can implement that reduction. Rotations require appropriate evaluation keys and have computational and memory costs; they are not free array indexing.

A useful systems exercise is to plan the layout before writing the encrypted arithmetic. Decide what each slot means, which shifts are needed, how partial results will be combined, and which keys the evaluator actually requires. Different layouts can implement the same mathematical function with very different costs.

Encoding examples: SEAL encoders. Rotation keys and operations: SEAL rotations.

9. What bootstrapping accomplishes

Bootstrapping refreshes a ciphertext so that evaluation can continue beyond its current budget. In the classic intuition, decryption-related computation is performed homomorphically using appropriate encrypted key material and evaluation keys. This does not mean giving the evaluator the plaintext secret key.

For approximate CKKS bootstrapping, the refresh itself is approximate. It makes additional computation possible while introducing its own error and consuming resources. It does not recover precision already lost earlier in the program. Where to bootstrap is therefore part of the numerical and execution plan, rather than a last-minute repair for an invalid computation.

Programmable bootstrapping in TFHE-style systems can combine refresh with evaluation of a supported function. That changes the way an application may express nonlinear or discrete operations. The relative cost of these approaches depends on the actual workload and implementation.

CKKS refresh stages and precision: OpenFHE bootstrapping guide. TFHE background: Zama’s technical introduction.

10. Where FHE meets machine learning

Consider private inference: a client encrypts features, a service evaluates a model, and the client decrypts a prediction. Linear layers fit naturally into arithmetic formulations. The difficult part is often the rest of the model: activations, normalization, comparison, and selection can dominate an encrypted design.

A designer might replace an activation with a low-degree polynomial over a chosen input interval, use a discrete representation, or restructure the model around the cost of the target scheme. Each decision creates an accuracy–cost trade-off. A polynomial that works well on a training distribution may behave poorly outside its approximation interval.

It helps to keep three errors separate: the model’s ordinary prediction error, the approximation introduced by changing the computation, and the numerical error of encrypted evaluation. A useful experiment evaluates them separately before reporting a combined accuracy number.

Input encryption does not automatically hide the model, validate the prediction, protect training records from every inference attack, or make unrestricted query access safe. Those are separate requirements that need an explicit protocol and threat model. The same applies to encrypted training: supporting the required operations does not make the full training workload inexpensive.

For arithmetic support and implementation examples, see OpenFHE’s examples and the SEAL introduction. The error decomposition above is an engineering way to organize evaluation, not a benchmark result.

11. What FHE does not guarantee by itself

Confidentiality is not the same as integrity. A server can return the wrong result or fail to execute the agreed computation. Ciphertext encryption alone is not a proof of correct evaluation. Origin authentication, verification mechanisms, or other protocol protections may be needed, depending on the application.

The boundary around decryption also matters. Do not treat arbitrary ciphertexts, decryption failures, noise measurements, or approximate decrypted values as harmless data to expose across trust boundaries. Microsoft SEAL’s security guidance specifically discusses risks from secret-key-dependent information and from sharing CKKS decryptions.

FHE also does not erase traffic patterns, message sizes, timing, application identifiers, or information deliberately revealed in the final output. A practical design still needs key protection, authenticated transport, access control, safe input handling, and a clear policy for who may request which computation.

Security-model and ciphertext-authenticity details: Microsoft SEAL security guidance. Parameter selection: HE security guidelines.

12. A practical development workflow

  1. Specify the trust boundary. Write down who owns the secret key, what the server learns, who receives outputs, and whether the evaluator may be malicious.
  2. Build a plaintext reference. Fix the function, input range, accuracy target, and expected outputs before adding encryption.
  3. Plan the representation. Choose a scheme and encoding, then estimate depth, intermediate ranges, precision, packing, rotations, and evaluation-key requirements.
  4. Select parameters using current guidance. Start from maintained library examples and security recommendations, not copied parameter numbers detached from their workload.
  5. Measure the full pipeline. Include encoding, encryption, key generation and transfer, server evaluation, communication, decryption, and memory. Separate one-time setup from recurring query cost.
  6. Test difficult inputs and failure cases. Check approximation boundaries, overflow assumptions, malformed inputs, concurrency, and output-release policies.

This is the conceptual division of work, not executable library code:

# Conceptual pseudocode — not a cryptographic implementation
parameters = choose_for(function, security_target, accuracy)
public_key, secret_key, evaluation_keys = keygen(parameters)

# Client
ciphertext = encrypt(public_key, encode(input))

# Evaluator: no plaintext input or secret key is supplied
result_ciphertext = evaluate(function, ciphertext, evaluation_keys)

# Authorized decryptor
result = decode(decrypt(secret_key, result_ciphertext))

Libraries are a starting point, not a substitute for this design work. OpenFHE provides multiple arithmetic and Boolean-family capabilities. Microsoft SEAL provides arithmetic HE examples, and TFHE-rs is a Rust implementation in the TFHE ecosystem. Check the current documentation, supported operations, and security guidance for the library you choose.

A useful result is more than “the encrypted answer matches.” It also explains the trust assumptions, numerical tolerance, security parameters, workload, and end-to-end cost.

References and further reading

This is an explanatory research note, not a claim of a new cryptographic construction or a substitute for a scheme specification. Examples and illustrations are educational.

  1. Brakerski, Gentry, and Vaikuntanathan — Fully Homomorphic Encryption without Bootstrapping. Circuit depth and leveled FHE.
  2. Fan and Vercauteren — Somewhat Practical Fully Homomorphic Encryption. Ring-based arithmetic and relinearization.
  3. Cheon, Kim, Kim, and Song — Homomorphic Encryption for Arithmetic of Approximate Numbers. The CKKS construction.
  4. Chillotti, Gama, Georgieva, and Izabachène — Faster Fully Homomorphic Encryption. TFHE-family foundations.
  5. TFHE Deep Dive, Part I. Ciphertext types and noise intuition.
  6. Microsoft SEAL encoding examples, CKKS example, and rotation example.
  7. OpenFHE CKKS bootstrapping guide. Refresh stages and precision.
  8. HomomorphicEncryption.org security guidelines. Parameter and security guidance.
  9. Microsoft SEAL security guidance. Decryption boundaries and ciphertext authenticity.
About the author: Reeshav Chowdhury · IIT Kharagpur · Research interests in AI · Privacy · Security · Blockchain. Academic publications on Google Scholar ↗
← Back to the blog