<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Homomorphic Encryption on kenji.blog</title><link>http://kenji.blog/en/tags/homomorphic-encryption/</link><description>Recent content in Homomorphic Encryption on kenji.blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>kenjinote</copyright><lastBuildDate>Fri, 11 Sep 2026 11:00:00 +0900</lastBuildDate><atom:link href="http://kenji.blog/en/tags/homomorphic-encryption/index.xml" rel="self" type="application/rss+xml"/><item><title>What is Fully Homomorphic Encryption (FHE)? Explaining the Keystone of Next-Generation Security</title><link>http://kenji.blog/en/p/fully-homomorphic-encryption-fhe-explained/</link><pubDate>Fri, 11 Sep 2026 11:00:00 +0900</pubDate><guid>http://kenji.blog/en/p/fully-homomorphic-encryption-fhe-explained/</guid><description>&lt;img src="http://kenji.blog/p/fully-homomorphic-encryption-fhe-explained/img/eyecatch.jpg" alt="Featured image of post What is Fully Homomorphic Encryption (FHE)? Explaining the Keystone of Next-Generation Security" />&lt;p>As cloud computing and AI technologies become established as societal infrastructure, the tradeoff between &amp;ldquo;data privacy&amp;rdquo; and &amp;ldquo;data utilization&amp;rdquo; has become one of the most critical challenges. While there is a growing demand to have AI analyze highly sensitive data—such as medical records, financial information, and personal biometric data—on the cloud, many companies hesitate to send data externally due to security concerns.&lt;/p>
&lt;p>Traditional encryption technologies (like AES and RSA) excel at protecting data stored in storage (Data at Rest) and data flowing over networks (Data in Transit). However, &lt;strong>when performing processing (computations) such as searching or machine learning on the server side (Data in Use), the ciphertext must first be decrypted back into plaintext&lt;/strong>. If the server is hacked at this decrypted moment, or if a malicious internal administrator peeks at the data, it directly leads to information leakage.&lt;/p>
&lt;p>The dream technology that overcomes this fundamental weakness of &amp;ldquo;decryption during processing&amp;rdquo; is &lt;strong>Fully Homomorphic Encryption (FHE)&lt;/strong>. By using FHE, it becomes possible to perform computational processing while keeping the data encrypted, without ever decrypting it, and returning only the resulting ciphertext to the client.&lt;/p>
&lt;p>In this article, we will thoroughly and deeply explain FHE, the keystone of next-generation security, covering everything from its concept and history, the groundbreaking breakthrough by Craig Gentry, mathematical foundations (such as Ring-LWE), its biggest challenge &amp;ldquo;noise&amp;rdquo; and its solution (bootstrapping), up to the latest implementation libraries.&lt;/p>
&lt;hr>
&lt;h2 id="1-what-is-homomorphic-encryption-basic-concepts">1. What is Homomorphic Encryption? Basic Concepts
&lt;/h2>&lt;p>&amp;ldquo;Homomorphic&amp;rdquo; is an algebraic term referring to the property where mappings can be made between sets with a certain structure while preserving the structure of the operations. &amp;ldquo;Homomorphism&amp;rdquo; in cryptography is the property where &lt;strong>operations in the plaintext space correspond to operations in the ciphertext space&lt;/strong>.&lt;/p>
&lt;p>Expressed in simple formulas, let $m_1$ and $m_2$ be plaintexts, $E(\cdot)$ be the encryption function, and $D(\cdot)$ be the decryption function. If we let $\circ$ be an operation on the plaintext (such as addition or multiplication) and $\diamond$ be an operation on the ciphertext, the following relationship holds:&lt;/p>
$$ D(E(m_1) \diamond E(m_2)) = m_1 \circ m_2 $$
&lt;p>In other words, if you decrypt the result of applying some operation $\diamond$ to the ciphertexts $E(m_1)$ and $E(m_2)$, it matches the result of operating $\circ$ on the original plaintexts.&lt;/p>
&lt;h3 id="data-flow-in-cloud-computing">Data Flow in Cloud Computing
&lt;/h3>&lt;p>The architecture of cloud processing using FHE is completely different from traditional ones. The following diagram shows the flow of secure data processing utilizing FHE.&lt;/p>
&lt;div class="mermaid">graph TD
A["Client (Holds secret key)"] -->|1. Encrypt plaintext x: E(x)| B["Cloud Server (Encrypted data only)"]
B -->|2. Apply function f to ciphertext: E(f(x))| B
B -->|3. Ciphertext of calculation result E(y)| A
A -->|4. Decrypt with secret key: y = f(x)| A
style A fill:#d4edda,stroke:#28a745
style B fill:#f8d7da,stroke:#dc3545&lt;/div>
&lt;p>The server receives the encrypted data $E(x)$, but since it does not have the secret key, it can never know the contents of the data. However, by utilizing the properties of FHE, it can apply a function $f$ (for example, an inference model for machine learning) to the ciphertext and generate $E(f(x))$. The client receives this and decrypts it with their own secret key to obtain the desired result $y = f(x)$.&lt;/p>
&lt;hr>
&lt;h2 id="2-history-of-homomorphic-encryption-evolution-phe-she-fhe">2. History of Homomorphic Encryption Evolution: PHE, SHE, FHE
&lt;/h2>&lt;p>Homomorphic encryption did not reach its current &amp;ldquo;fully&amp;rdquo; form all at once. It is broadly classified into three stages depending on the types and number of operations it can achieve.&lt;/p>
&lt;h3 id="partially-homomorphic-encryption-phe">Partially Homomorphic Encryption (PHE)
&lt;/h3>&lt;p>PHE is an encryption scheme that can perform &lt;strong>only one of either&lt;/strong> addition or multiplication indefinitely. In fact, ciphers with this property have existed for a long time.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>RSA Encryption (Homomorphism for multiplication)&lt;/strong>
RSA encryption unintentionally possessed a multiplicative homomorphic property. Given plaintexts $m_1, m_2$ and a public key $(e, N)$:
$$ E(m_1) = m_1^e \pmod N $$
$$ E(m_2) = m_2^e \pmod N $$
Multiplying these gives:
$$ E(m_1) \times E(m_2) = (m_1 \cdot m_2)^e \pmod N = E(m_1 \times m_2) $$
Thus, the multiplication of ciphertexts corresponds to the multiplication of plaintexts.&lt;/li>
&lt;li>&lt;strong>Paillier Encryption (Homomorphism for addition)&lt;/strong>
The Paillier cryptosystem, invented in 1999, has an additive homomorphic property. It has been put to practical use in applications like electronic voting (aggregating encrypted votes and decrypting only the final result).&lt;/li>
&lt;/ul>
&lt;h3 id="somewhat-homomorphic-encryption-she">Somewhat Homomorphic Encryption (SHE)
&lt;/h3>&lt;p>This scheme can execute &lt;strong>both&lt;/strong> addition and multiplication, but there is a &lt;strong>limit to the number of operations (circuit depth)&lt;/strong> that can be performed. Due to the accumulation of &amp;ldquo;noise,&amp;rdquo; which will be discussed later, decryption becomes impossible after a certain number of multiplications. The BGN (Boneh-Goh-Nissim) cryptosystem of 2005 falls under this category, but it had limitations in performing practical, complex computations (like deep learning).&lt;/p>
&lt;h3 id="fully-homomorphic-encryption-fhe">Fully Homomorphic Encryption (FHE)
&lt;/h3>&lt;p>This is an encryption scheme that can execute both addition and multiplication an &lt;strong>unlimited number of times&lt;/strong>. Similar to Turing completeness in information theory, if addition (equivalent to XOR) and multiplication (equivalent to AND) can be combined infinitely, it means that in principle, any computable function or algorithm can be executed while remaining encrypted.&lt;/p>
&lt;p>FHE was long called the &amp;ldquo;holy grail of cryptography&amp;rdquo; and was even said to be impossible to realize. However, in 2009, &lt;strong>Craig Gentry&lt;/strong>, who was a doctoral student at Stanford University at the time, proposed the first FHE scheme using Ideal Lattices, sending shockwaves through the world.&lt;/p>
&lt;hr>
&lt;h2 id="3-mathematical-foundations-of-fhe-the-lwe-problem-and-ring-lwe">3. Mathematical Foundations of FHE: The LWE Problem and Ring-LWE
&lt;/h2>&lt;p>Many of the current mainstream FHE schemes are based on the &lt;strong>LWE (Learning With Errors) problem&lt;/strong>, a mathematical hard problem in &amp;ldquo;Lattice-based Cryptography,&amp;rdquo; which is also known as Post-Quantum Cryptography.&lt;/p>
&lt;h3 id="intuitive-understanding-of-the-lwe-problem">Intuitive Understanding of the LWE Problem
&lt;/h3>&lt;p>Solving a system of linear equations is easy if you use methods like Gaussian elimination.&lt;/p>
$$ \begin{cases} 3s_1 + 4s_2 + 2s_3 \equiv 12 \pmod{17} \\ 1s_1 + 9s_2 + 5s_3 \equiv 8 \pmod{17} \\ \vdots \end{cases} $$
&lt;p>However, what happens if we add a very small &amp;ldquo;random error (noise)&amp;rdquo; $e$ to the results of these equations?&lt;/p>
$$ \begin{cases} 3s_1 + 4s_2 + 2s_3 + e_1 \equiv 13 \pmod{17} \\ 1s_1 + 9s_2 + 5s_3 + e_2 \equiv 7 \pmod{17} \\ \vdots \end{cases} $$
&lt;p>With just the addition of this error $e$, the problem of finding the secret variable vector $\vec{s}$ transforms into an NP-hard problem that is difficult to decipher even using current supercomputers or quantum computers. This is the LWE problem.&lt;/p>
&lt;h3 id="ring-lwe-problem-rlwe">Ring-LWE Problem (RLWE)
&lt;/h3>&lt;p>The standard LWE problem involves matrix operations, which means the key size is extremely large (sometimes in gigabytes) and computational efficiency is poor. To solve this, the &lt;strong>Ring-LWE (RLWE) problem&lt;/strong>, which uses operations over polynomial rings, was introduced.&lt;/p>
&lt;p>In RLWE, elements belong to the polynomial ring $R_q = \mathbb{Z}_q[x] / (x^N + 1)$ (where $N$ is a power of 2, and $q$ is the modulus prime).
Let the secret key be a polynomial $s(x)$, and with a random polynomial $a(x)$ and a small noise polynomial $e(x)$, the public key becomes the following pair:&lt;/p>
$$ (a(x), b(x)) \quad \text{where} \quad b(x) = -a(x) \cdot s(x) + e(x) \pmod q $$
&lt;p>During encryption, the plaintext $m(x)$ is encoded using the properties of this polynomial to generate the ciphertext.&lt;/p>
&lt;hr>
&lt;h2 id="4-the-biggest-barrier-noise-and-gentrys-bootstrapping">4. The Biggest Barrier &amp;ldquo;Noise&amp;rdquo; and Gentry&amp;rsquo;s Bootstrapping
&lt;/h2>&lt;p>The most important concept in understanding FHE is &lt;strong>&amp;ldquo;noise management.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;p>In LWE/RLWE-based cryptography, small &amp;ldquo;noise (errors)&amp;rdquo; are intentionally included to ensure security.
The process of decrypting a ciphertext $c$ of a plaintext $m$ can be roughly represented by the following formula:&lt;/p>
$$ D(c) = (c \cdot s) \pmod q = m + \text{noise} $$
&lt;p>During decryption, this &lt;code>noise&lt;/code> is removed through rounding processes or similar to obtain the correct plaintext $m$. However, when homomorphic operations (especially multiplication) are performed between ciphertexts, this noise is dramatically amplified.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Homomorphic Addition&lt;/strong>: Noise increases additively ($e_1 + e_2$). This is a relatively gradual increase.&lt;/li>
&lt;li>&lt;strong>Mathematical Representation of Homomorphism by Homomorphic Addition&lt;/strong>:
$$ E(m_1) \oplus E(m_2) = E(m_1 + m_2) $$&lt;/li>
&lt;li>&lt;strong>Homomorphic Multiplication&lt;/strong>: Noise explodes multiplicatively (because it includes terms like $e_1 \times e_2$). After just a few multiplications, the noise exceeds the threshold $q/2$, preventing correct rounding and causing decryption to fail.&lt;/li>
&lt;li>&lt;strong>Mathematical Representation of Homomorphism by Homomorphic Multiplication&lt;/strong>:
$$ E(m_1) \otimes E(m_2) = E(m_1 \times m_2) $$&lt;/li>
&lt;/ul>
&lt;p>This is the reason why FHE could not be realized for a long time and remained at the level of SHE (with a limited number of operations).&lt;/p>
&lt;h3 id="the-magic-of-bootstrapping">The Magic of Bootstrapping
&lt;/h3>&lt;p>Craig Gentry&amp;rsquo;s genius contribution was inventing a noise reduction technique called &lt;strong>&amp;ldquo;bootstrapping.&amp;rdquo;&lt;/strong> This was a paradigm shift in cryptography.&lt;/p>
&lt;p>Intuitively, it is the operation of &amp;ldquo;&amp;lsquo;decrypting&amp;rsquo; the ciphertext to clean it while it remains encrypted, and putting it into a new ciphertext before it becomes too noisy and breaks.&amp;rdquo;&lt;/p>
&lt;ol>
&lt;li>Suppose we have a highly noisy ciphertext $C_{noisy}$.&lt;/li>
&lt;li>The client provides the server in advance with the secret key $sk$ &amp;ldquo;encrypted with the public key,&amp;rdquo; $E_{pk}(sk)$ (this is called the bootstrapping key).&lt;/li>
&lt;li>The server runs a &lt;strong>Decryption Circuit&lt;/strong> homomorphically on $C_{noisy}$.&lt;/li>
&lt;li>Specifically, it performs a &amp;ldquo;decryption within the encrypted space&amp;rdquo; on $E_{pk}(C_{noisy})$ using $E_{pk}(sk)$.&lt;/li>
&lt;li>Since this decryption circuit itself is a homomorphic operation, it generates new noise, but the noise of the newly output ciphertext $C_{fresh}$ is reset to a fixed &amp;ldquo;constant level.&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;div class="mermaid">graph LR
A["High noise ciphertext C_noisy"] --> B["Homomorphic decryption circuit (Eval_Dec)"]
C["Encrypted secret key E(sk)"] --> B
B --> D["Low noise ciphertext C_fresh"]
style B fill:#ffeeba,stroke:#ffc107&lt;/div>
&lt;p>By executing this bootstrapping periodically during computation, it theoretically became possible to compute circuits of infinite depth (achieving FHE). However, Gentry&amp;rsquo;s early scheme was desperately expensive computationally, with a single bootstrapping operation taking anywhere from tens of minutes to hours.&lt;/p>
&lt;hr>
&lt;h2 id="5-generations-of-fhe-and-the-evolution-of-major-schemes">5. Generations of FHE and the Evolution of Major Schemes
&lt;/h2>&lt;p>In the race toward practical FHE, cryptographers around the world have competed to improve the algorithms. Currently, FHE is mainly classified into four generations or families.&lt;/p>
&lt;h3 id="2nd-generation-exact-integer-arithmetic-bgv-bfv">2nd Generation: Exact Integer Arithmetic (BGV, BFV)
&lt;/h3>&lt;p>The &lt;strong>BGV (Brakerski-Gentry-Vaikuntanathan)&lt;/strong> and &lt;strong>BFV (Brakerski/Fan-Vercauteren)&lt;/strong> schemes appeared between 2011 and 2012. These are based on RLWE and are suitable for integer modular arithmetic (exact calculations).
They support batching techniques like SIMD (Single Instruction, Multiple Data), characterized by the ability to pack thousands of data slots into a single large polynomial ciphertext and compute them in parallel all at once.&lt;/p>
&lt;h3 id="3rd-generation-accelerated-bootstrapping-gsw-fhew-tfhe">3rd Generation: Accelerated Bootstrapping (GSW, FHEW, TFHE)
&lt;/h3>&lt;p>The &lt;strong>GSW (Gentry-Sahai-Waters)&lt;/strong> scheme of 2013 made the structure of FHE simpler. This was developed further into &lt;strong>TFHE (Fast Fully Homomorphic Encryption over the Torus)&lt;/strong>, one of the mainstream schemes today.
The hallmark of TFHE is its extremely fast bootstrapping (on the order of milliseconds). It excels at gate-level operations (logic circuits like AND, XOR), and since the ciphertext size is relatively small, it is suited for fast evaluation of arbitrary logic circuits.&lt;/p>
&lt;h3 id="4th-generation-specialization-for-approximate-calculation-and-machine-learning-ckks">4th Generation: Specialization for Approximate Calculation and Machine Learning (CKKS)
&lt;/h3>&lt;p>The &lt;strong>CKKS (Cheon-Kim-Kim-Song)&lt;/strong> scheme proposed by Cheon et al. in 2017 can be called the definitive technology for privacy protection in current AI and machine learning.
While previous FHEs insisted on &amp;ldquo;exact integer calculations,&amp;rdquo; CKKS supports &lt;strong>&amp;ldquo;approximate calculations of floating-point numbers&amp;rdquo;&lt;/strong> while remaining encrypted. It demonstrates overwhelming performance in real number calculations where small errors are tolerable, such as the training and inference of neural networks.&lt;/p>
&lt;p>The table below summarizes how to choose a scheme by purpose.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th style="text-align:left">Scheme Name&lt;/th>
&lt;th style="text-align:left">Preferred Data Type&lt;/th>
&lt;th style="text-align:left">Recommended Use Cases&lt;/th>
&lt;th style="text-align:left">Features&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td style="text-align:left">&lt;strong>BFV / BGV&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Integer&lt;/td>
&lt;td style="text-align:left">Exact statistical calculations, financial data aggregation, DB queries&lt;/td>
&lt;td style="text-align:left">High throughput via SIMD batching&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;strong>CKKS&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Real/Complex&lt;/td>
&lt;td style="text-align:left">Machine learning (DNN, logistic regression), signal processing&lt;/td>
&lt;td style="text-align:left">Acceleration via approximate calculation, rescaling&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td style="text-align:left">&lt;strong>TFHE&lt;/strong>&lt;/td>
&lt;td style="text-align:left">Boolean&lt;/td>
&lt;td style="text-align:left">Arbitrary logic circuits, string search, evaluation of non-linear functions&lt;/td>
&lt;td style="text-align:left">Ultra-fast bootstrapping (millisecond range)&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;hr>
&lt;h2 id="6-practice-fhe-libraries-and-conceptual-code">6. Practice: FHE Libraries and Conceptual Code
&lt;/h2>&lt;p>Today, many open-source libraries are provided that allow you to use FHE without deep cryptographic knowledge.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Microsoft SEAL (Simple Encrypted Arithmetic Library)&lt;/strong>: A C++ library supporting BFV, BGV, and CKKS. One of the industry standards. Its Python binding, &lt;strong>TenSEAL&lt;/strong>, is popular among AI engineers.&lt;/li>
&lt;li>&lt;strong>Zama (Concrete)&lt;/strong>: A framework based on TFHE. You can write in Rust/Python, and it provides functionality (Concrete ML) to compile existing PyTorch models and run them on FHE.&lt;/li>
&lt;li>&lt;strong>OpenFHE&lt;/strong>: The successor to PALISADE, a comprehensive C++ library supporting all major schemes.&lt;/li>
&lt;/ul>
&lt;h3 id="example-of-fhe-programming-using-python-tenseal">Example of FHE Programming using Python (TenSEAL)
&lt;/h3>&lt;p>Here, we show a conceptual Python code example using the CKKS scheme to add and multiply real number vectors while they remain encrypted.&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt"> 1
&lt;/span>&lt;span class="lnt"> 2
&lt;/span>&lt;span class="lnt"> 3
&lt;/span>&lt;span class="lnt"> 4
&lt;/span>&lt;span class="lnt"> 5
&lt;/span>&lt;span class="lnt"> 6
&lt;/span>&lt;span class="lnt"> 7
&lt;/span>&lt;span class="lnt"> 8
&lt;/span>&lt;span class="lnt"> 9
&lt;/span>&lt;span class="lnt">10
&lt;/span>&lt;span class="lnt">11
&lt;/span>&lt;span class="lnt">12
&lt;/span>&lt;span class="lnt">13
&lt;/span>&lt;span class="lnt">14
&lt;/span>&lt;span class="lnt">15
&lt;/span>&lt;span class="lnt">16
&lt;/span>&lt;span class="lnt">17
&lt;/span>&lt;span class="lnt">18
&lt;/span>&lt;span class="lnt">19
&lt;/span>&lt;span class="lnt">20
&lt;/span>&lt;span class="lnt">21
&lt;/span>&lt;span class="lnt">22
&lt;/span>&lt;span class="lnt">23
&lt;/span>&lt;span class="lnt">24
&lt;/span>&lt;span class="lnt">25
&lt;/span>&lt;span class="lnt">26
&lt;/span>&lt;span class="lnt">27
&lt;/span>&lt;span class="lnt">28
&lt;/span>&lt;span class="lnt">29
&lt;/span>&lt;span class="lnt">30
&lt;/span>&lt;span class="lnt">31
&lt;/span>&lt;span class="lnt">32
&lt;/span>&lt;span class="lnt">33
&lt;/span>&lt;span class="lnt">34
&lt;/span>&lt;span class="lnt">35
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="kn">import&lt;/span> &lt;span class="nn">tenseal&lt;/span> &lt;span class="k">as&lt;/span> &lt;span class="nn">ts&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 1. Context setup (including key generation)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Use CKKS scheme, set polynomial degree to 8192&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">context&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">ts&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">(&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">ts&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">SCHEME_TYPE&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">CKKS&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">poly_modulus_degree&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mi">8192&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">coeff_mod_bit_sizes&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">[&lt;/span>&lt;span class="mi">60&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">40&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">40&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">60&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">context&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">generate_galois_keys&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">context&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">global_scale&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="mi">2&lt;/span>&lt;span class="o">**&lt;/span>&lt;span class="mi">40&lt;/span> &lt;span class="c1"># Scaling factor for real numbers&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 2. Client side: Data encryption&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">vector1&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mf">1.5&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">2.5&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">3.5&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">vector2&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="mf">2.0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">3.0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mf">4.0&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Convert plaintext vectors to ciphertexts (should be executed on the client side)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">enc_v1&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">ts&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">ckks_vector&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">vector1&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">enc_v2&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">ts&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">ckks_vector&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">context&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">vector2&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 3. Server side: Computations while encrypted (Protection of Data in Use)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># The server does not know the plaintexts but can perform addition and multiplication&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">enc_add&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">enc_v1&lt;/span> &lt;span class="o">+&lt;/span> &lt;span class="n">enc_v2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">enc_mul&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">enc_v1&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="n">enc_v2&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># 4. Client side: Decryption of results&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Only the client with the secret key can view the results&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">res_add&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">enc_add&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">decrypt&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">res_mul&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">enc_mul&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">decrypt&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;Decrypted addition result: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">res_add&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Example output: [3.5000001, 5.5000001, 7.5000002] (Includes minute errors due to approximate calculation)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nb">print&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="sa">f&lt;/span>&lt;span class="s2">&amp;#34;Decrypted multiplication result: &lt;/span>&lt;span class="si">{&lt;/span>&lt;span class="n">res_mul&lt;/span>&lt;span class="si">}&lt;/span>&lt;span class="s2">&amp;#34;&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="c1"># Example output: [3.0000002, 7.5000005, 14.0000003]&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>As you can see from the code above, you can intuitively describe computations between ciphertexts by overloading normal Python operators, such as &lt;code>enc_v1 + enc_v2&lt;/code>. On the server side, vector operations are completed without knowing the contents of the vectors.&lt;/p>
&lt;hr>
&lt;h2 id="7-fhe-challenges-performance-and-hardware-acceleration">7. FHE Challenges: Performance and Hardware Acceleration
&lt;/h2>&lt;p>While FHE provides theoretically perfect security, its biggest challenge for practical use is &lt;strong>&amp;ldquo;performance overhead.&amp;rdquo;&lt;/strong>&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Computational Overhead&lt;/strong>: Compared to computing in plaintext, computing in ciphertext is thousands to tens of thousands of times slower on a CPU. Polynomial multiplications and bootstrapping require massive amounts of FFT (Fast Fourier Transform) or NTT (Number Theoretic Transform) calculations.&lt;/li>
&lt;li>&lt;strong>Ciphertext Expansion&lt;/strong>: A few bytes of plaintext can expand to several megabytes when encrypted. This puts severe pressure on memory bandwidth and network bandwidth.&lt;/li>
&lt;/ol>
&lt;h3 id="approaches-to-hardware-solutions">Approaches to Hardware Solutions
&lt;/h3>&lt;p>To overcome this overhead, the development of dedicated FHE hardware accelerators (ASIC, FPGA, GPU support) is progressing worldwide.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>GPU Acceleration&lt;/strong>: Efforts are underway to parallelize NTT operations and bootstrapping using powerful GPUs from NVIDIA and others, with reports of speeds tens of times faster than software implementations (e.g., 100x.ai, Zama&amp;rsquo;s TFHE-rs CUDA backend).&lt;/li>
&lt;li>&lt;strong>DARPA DPRIVE Project&lt;/strong>: The US Defense Advanced Research Projects Agency (DARPA) is promoting the &amp;ldquo;DPRIVE (Data Protection in Virtual Environments)&amp;rdquo; project to develop dedicated hardware to bring the computational speed of FHE to parity with plaintext processing (within a 10x overhead). Intel, Microsoft, and Intellectual Ventures are participating.&lt;/li>
&lt;li>&lt;strong>Emergence of FPUs (FHE Processing Units)&lt;/strong>: Startups like Cornami and Optalysys are embarking on the development of FHE-specific chips using optical computing and specialized silicon architectures.&lt;/li>
&lt;/ul>
&lt;p>In the near future, an era may come where &amp;ldquo;FPUs&amp;rdquo; become a standard feature in server and cloud infrastructure, just like NPUs (Neural Processing Units) in AI.&lt;/p>
&lt;hr>
&lt;h2 id="8-expected-use-cases">8. Expected Use Cases
&lt;/h2>&lt;p>Now that FHE is approaching practical speeds, disruptive innovations are expected in areas such as:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>Privacy Protection in Medical and Genomic Analysis&lt;/strong>:
By having a cloud AI learn from patients&amp;rsquo; medical records and DNA data held by multiple hospitals while keeping it encrypted with FHE, highly accurate cancer diagnostic models and new drug development can be performed without violating privacy laws (like HIPAA or GDPR).&lt;/li>
&lt;li>&lt;strong>Fraud Detection and Anti-Money Laundering (AML) for Financial Institutions&lt;/strong>:
Competing banks can cross-analyze data in an encrypted state to detect massive illegal money transfer networks, without revealing customer account information or transaction histories to each other.&lt;/li>
&lt;li>&lt;strong>Secure AI Inference APIs (MaaS: Model as a Service)&lt;/strong>:
Users encrypt their voice, facial images, and prompts before sending them to AI services (like LLMs such as ChatGPT). The AI provider generates the answer without ever knowing the user&amp;rsquo;s input and returns it as a ciphertext. This completely dispels the concern of &amp;ldquo;AI learning or peeking at personal information.&amp;rdquo;&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="9-conclusion-the-future-of-cryptography-is-unseen-computation">9. Conclusion: The Future of Cryptography is &amp;ldquo;Unseen Computation&amp;rdquo;
&lt;/h2>&lt;p>Just as the invention of public key cryptography (RSA) in the 1970s enabled secure communication on the Internet (such as HTTPS), Craig Gentry&amp;rsquo;s invention of FHE is one of the most important milestones in the history of cryptography.&lt;/p>
&lt;p>Today, Fully Homomorphic Encryption (FHE) has leapt from the theories of laboratories into the stage where Microsoft, IBM, Intel, Google, and many startups are fiercely competing toward practical application. While challenges regarding computational cost and data size still exist, thanks to the refinement of algorithms and the evolution of hardware accelerators, performance improvements continue at a pace exceeding Moore&amp;rsquo;s Law.&lt;/p>
&lt;p>In a few years, &amp;ldquo;computing data while keeping it encrypted&amp;rdquo; will not be something special, but will likely become the standard data protection best practice in cloud services. FHE is the keystone of next-generation security, realizing the &lt;strong>ultimate combination of privacy and data utilization&lt;/strong> in a data-driven society.&lt;/p></description></item></channel></rss>