Can Homomorphic Encryption Be Practical?
Can Homomorphic Encryption Be Practical?
Abstract. The prospect of outsourcing an increasing amount of data storage and man-
agement to cloud services raises many new privacy concerns for individuals and businesses
alike. The privacy concerns can be satisfactorily addressed if users encrypt the data they
send to the cloud. If the encryption scheme is homomorphic, the cloud can still perform
meaningful computations on the data, even though it is encrypted.
First, we exhibit a number of real-world applications, in the medical, financial, and the
advertising domains, which require only that the encryption scheme is “somewhat” homo-
morphic. Somewhat homomorphic encryption schemes, which support a limited number of
homomorphic operations, can be much faster, and more compact than fully homomorphic
encryption schemes.
Secondly, we show a proof-of-concept implementation of the recent somewhat homomor-
phic encryption scheme of Brakerski and Vaikuntanathan, whose security relies on the “ring
learning with errors” (Ring LWE) problem. The system is very efficient, and has reasonably
short ciphertexts. Our unoptimized implementation in magma enjoys comparable efficiency
to even optimized pairing-based schemes with the same level of security and homomorphic
capacity. We also show a number of application-specific optimizations to the encryption
scheme, most notably the ability to convert between different message encodings in a ci-
phertext.
Keywords: Fully Homomorphic Encryption, Ring Learning with Errors, Lattices, MAGMA
1 Introduction
The development of cloud storage and computing platforms allows users to outsource storage and
computations on their data, and allows businesses to offload the task of maintaining data-centers.
However, concerns over loss of privacy and business value of private data is an overwhelming barrier
to the adoption of cloud services by consumers and businesses alike. An excellent way to assuage
these privacy concerns is to store all data in the cloud encrypted, and perform computations on
encrypted data. To this end, we need an encryption scheme that allows meaningful computation
on encrypted data, namely a homomorphic encryption scheme.
⋆
This research was conducted while the second and third authors were at Microsoft Research Redmond.
Full version of the ACM CCSW 2011 paper.
2 Kristin Lauter, Michael Naehrig, and Vinod Vaikuntanathan
Homomorphic encryption schemes that allow simple computations on encrypted data have been
known for a long time. For example, the encryption systems of Goldwasser and Micali [GM82], El
Gamal [El-84], Cohen and Fischer [CF85], and Paillier [Pai99] support either adding or multiplying
encrypted ciphertexts, but not both operations at the same time. Boneh, Goh and Nissim [BGN05]
were the first to construct a scheme capable of performing both operations at the same time – their
scheme handles an arbitrary number of additions but just one multiplication. More recently, in a
breakthrough work, Gentry [Gen09,Gen10] constructed a fully homomorphic encryption scheme
(FHE) capable of evaluating an arbitrary number of additions and multiplications (and thus,
compute any function) on encrypted data.
The main point of this paper is to show to what extent current schemes can actually be used
to compute functions of practical interest on encrypted data. Since the appearance of Gentry’s
scheme, there has been much informal discussion in the industry as to whether fully homomorphic
encryption is implementable and practical. While the initial solution may not have been practical,
subsequent developments produced other schemes [DGHV10,SV10,SS10] leading up to the most
recent solutions of Brakerski and Vaikuntanathan [BV11b,BV11a], an implementation of which
we consider in this paper. The scheme is efficient and simple, produces short ciphertexts, and its
security is based on the ring learning with errors (Ring LWE) problem [LPR10].
While the performance of the state-of-the art FHE implementations is itself a question of
interest (and has indeed been considered recently in, e.g., [GH11,SV11]), our focus here is on
describing concrete practical applications and concrete useful functions to be computed, most
of which require only a limited number of multiplications of ciphertexts (as well as a possibly
very large number of additions of ciphertexts). For these applications, it is enough to consider
an implementation of a somewhat homomorphic encryption (SwHE) scheme, namely, one which
allows a fixed number of multiplications of ciphertexts. SwHE schemes are the building blocks
for the FHE schemes of, e.g., [Gen09,DGHV10,BV11b,BV11a], and provide much better efficiency
guarantees than their fully homomorphic counterparts.
ordinary laptop with an Intel Core 2 Duo processor running at 2.1 GHz, with 3MB L2 cache
and 1GB of memory, using Magma’s polynomial arithmetic for all computations in the ring of
polynomials modulo a prime q (denoted Rq ).
The first problem we face is that of choosing secure parameters for the encryption scheme.
Unlike traditional number-theory based systems, cryptosystems based on lattices and the learning
with errors (LWE) problem tend to be governed by a number of inter-related parameters. We follow
the methodology of Lindner and Peikert [LP11] (following earlier work of [GN08,MR09,RS10])
to choose these parameters correctly and securely.4 More precisely, fixing a parameter D – an
upper bound on the number of multiplication operations that the scheme supports – we compute
parameters of the scheme secure against an attacker with a time-to-advantage ratio of about 2120
(or larger) which, by the heuristics of Lenstra and Verheul [LV01], roughly translates to a security
level matching that of AES-128.
For parameter settings which support a single multiplication (i.e., D = 2) followed by a large
number of (integer) additions, the underlying ring in our scheme is Rq = Zq [x]/ hxn + 1i where
n = 2048 and q ≈ 258 is prime. We always set the error distribution for ring LWE to be a discrete
Gaussian with standard deviation σ = 8. In fact, for these choices of parameters, we get more
security than we asked for, namely a time-to-advantage ratio of about 2196 . 5 For this setting, the
key and ciphertext sizes, and the running times are as follows:
– The public key is 2n lg q ≈ 29 KB, the secret key is n lg q ≈ 14 KB, and a ciphertext generated
by the encryption algorithm is 2n lg q ≈ 29 KB. The ciphertext has two ring elements in
Rq = Zq [x]/ hf (x)i, however homomorphic multiplication adds another ring element to the
ciphertext making it 3n log q ≈ 43.5 KB.
– Key-generation runs in 250 milliseconds (ms), encryption takes 24 ms, whereas decryption takes
15–26 ms (depending on whether we are decrypting a 2- or 3-element ciphertext). Homomor-
phic addition is essentially instantaneous (i.e., takes less than 1 ms), whereas homomorphic
multiplication takes about 41 ms.
of our magma implementation is comparable to the BGN scheme. We remark that a C imple-
mentation (possibly using special purpose polynomial arithmetic along the lines of the SWIFFT
hash function [LMPR08]) would likely be several orders of magnitude faster than the magma
implementation that we report here.
We build on the somewhat homomorphic encryption, and implement simple statistics such
as mean, standard deviation and logistical regression, and report on the performance numbers
(See Section 5 for more details). To support computing these functions, we present two tricks to
encode messages appropriately. As such, the encryption scheme natively supports addition and
multplication modulo a fixed integer t, where t is a parameter of the system. The first trick shows
how to encode integers in a ciphertext so as to enable efficient computation of their sums and
products over the integers. This is useful in computing the mean, the standard deviation and
other private statistics efficiently. The second trick shows how to “pack” n encryptions of bits
into a single encryption of the n-bit string. Some homomorphic operations, e.g., comparison of
integers or private information retrieval, seem to require bit-wise encryptions of the input. Once
the answers are computed, though, they can be packed into a single encryption using this trick.
Finally, the work of [BV11a] shows how to make this scheme fully homomorphic under the same
assumption (Ring LWE) in an efficient way. Implementing the “bootstrapping” operation for this
system (thus, making it fully homomorphic) is a very interesting avenue for future implementation
efforts.
2 Cloud Services
Adoption of cloud services by consumers and businesses is limited by concerns over the loss of
privacy or business value of their private data. In this section we will describe concrete and
valuable applications of Somewhat Homomorphic Encryption which can help preserve customer
privacy while outsourcing various kinds of computation to the cloud. In all of these scenarios,
we imagine a future of streaming data from multiple sources, uploaded in encrypted form to the
cloud, and processed by the cloud to provide valuable services to the content owner. There are
two aspects of the computation to consider: the data itself, and the function to be computed on
this data. We consider cases where one or both of these are private or proprietary and should not
be shared with the cloud.
In all of these applications, we consider a single content-owner, who is the consumer for
the cloud service. All data that is encrypted and sent to the cloud is public-key encrypted to
the content-owner’s public key, using the semantically secure somewhat homomorphic encryption
scheme from [BV11b] described later in this paper.
certain dangerous health episodes. Encrypted input to the functions could include blood pressure
or heart monitor or blood sugar readings, for example, along with information about the patient
such as age, weight, gender, and other risk factors. The functions computed may not need to be
private in this case since they may be a matter of public health and thus public.
In the financial industry there is a potential application scenario in which both the data and the
function to be computed on the data is private and proprietary.
As an example, data about corporations, their stock price or their performance or inventory is
often relevant to making investment decisions. Data may even be streamed on a continuous basis
reflecting the most up-to-date information necessary for making decisions for trading purposes.
Functions which do computations on this data may be proprietary, based on new predictive models
for stock price performance and these models may be the product of costly research done by
financial analysts, so a company may want to keep these models private to preserve their advantage
and their investment.
With FHE, some functions can be evaluated privately as follows. The customer uploads an
encrypted version of the function to the cloud, for example a program where some of the evaluations
involve encrypted inputs which are specified. The streaming data is encrypted to the customer’s
public key and uploaded to the cloud. The cloud service evaluates the private function by applying
the encrypted description of the program to the encrypted inputs it receives. After processing, the
cloud returns the encrypted output to the customer.
Imagine an advertiser, for example a cosmetics company, who wants to use contextual information
to target advertising to potential customers. The consumer uses a mobile phone as a computing
device, and the device constantly uploads contextual information about the consumer, including
location, the time of day, information from email or browsing activity such as keywords from email
or browser searches. In the future, imagine that information is uploaded potentially constantly from
video devices: either pictures of objects of interest such as brands or faces which are automatically
identified, or from a video stream from a camera on the body which is identifying context in the
room (objects, people, workplace vs. home vs. store). When contextual information is uploaded
to the cloud server and made accessible to the cosmetics company, the company computes some
function of the contextual data and determine which targeted advertisement to send back to the
consumer’s phone.
Some examples of where context is important for advertising or providing targeted coupons:
beer commercials during sports events, or, you are near a Starbucks in the morning and a coffee
discount coupon for the Starbucks nearby is sent to your phone, or, cosmetics companies market
different products for different times of day (e.g. Friday night going out vs. Sunday morning
hanging out with the family), ads or coupons for shows if you are in New York near Broadway
in the evening. Other (private) contextual data might be: your income, your profession, your
purchasing history, your travel history, your address, etc.
Encrypted version: The problem with these scenarios is the invasion of privacy resulting from
giving that much detailed information about the consumer to the server or to the advertising
company. Now, imagine an encrypted version of this entire picture. All the contextual data is
encrypted and then uploaded to the server; the advertiser uploads encrypted ads to the server; the
server computes a function on the encrypted inputs which determines which encrypted ad to send
to the consumer; this function could be either private/proprietary or not. All contextual data and
all ads are encrypted to the consumer’s public key. Then the cloud can operate and compute on
this data, and the consumer can decrypt the received ad. As long as the cloud service provider
6 Kristin Lauter, Michael Naehrig, and Vinod Vaikuntanathan
does not collude with the advertisers, and semantically secure FHE encryption is employed, the
cloud and the advertisers don’t learn anything about the consumer’s data. 6
A couple of remarks are in order. First, we set the parameter choices for the encryption system
based on the expected number of multiplication operations to be done to compute the given
functions. These parameter choices determine the efficiency and security of the system. Thus
parameters for the system need to be changed as the functions to be computed change.
Secondly, so far we do not have a way to efficiently do divisions of real numbers or square roots.
Thus in the above computations, numerators and denominators need to be returned as separate
encryptions.
– We set f (x) to be the cyclotomic polynomial xn + 1 for n a power of two. In addition to many
other useful properties, the fact that f (x) = xn + 1 means that multiplication of ring elements
does not increase their L2 -norm by too much (see Lemma 2 below).
– The error distribution χ is the discrete Gaussian distribution DZn ,σ for some σ > 0, defined
by the probability density function
2 2
e−π||e|| /σ
∀e ∈ Zn : Pr[e ← DZn ,σ ] = P −π||e||2 /σ2
e∈Zn e
We present some elementary facts about the Gaussian distribution, and multiplication over
the ring Z[x]/ hxn + 1i. The first fact bounds the (Euclidean and therefore,
√ the ℓ∞ ) length of a
vector drawn from a discrete Gaussian of standard deviation σ by σ n. The second fact says that
multiplication in the ring Z[x]/ hxn + 1i increases the norm of the constituent elements only by a
modest amount.
√
Lemma 1 (see [MR07], Theorem 4.4). Let n ∈ N. For any real number σ > ω( log n), we
have
√
Pr [kxk∞ > σ n] ≤ 2−n+1 .
x←DZn ,σ
Lemma 2 (see [LM06,Gen09]). Let n ∈ N, and let f (x) = xn + 1 and let R = Z[x]/ hxn + 1i.
For any s, t ∈ R,
||s · t (mod xn + 1)||∞ ≤ n · ||s||∞ · ||t||∞ .
Solving the RLWE problem (for the stated parameters) is also known to give us a quantum
algorithm that solves short vector problems on ideal lattices with related parameters. The latter
problem is believed to be exponentially hard.
These parameters will be chosen (depending on the security parameter κ) in such a way as to
guarantee correctness and security of the scheme. See Section 5 for concrete choices of parameters.
8 Kristin Lauter, Michael Naehrig, and Vinod Vaikuntanathan
$
The Scheme SH.Keygen(1κ ): Sample a ring element s ← χ and define the secret key sk := s.
Sample a uniformly random ring element a1 ← Rq and an error e ← χ and compute the public
key pk := (a0 = −(a1 s + te), a1 ).
Publish pk and keep sk secret.
SH.Enc(pk, m): Recall that our message space is Rt . That is, we encode our message as a degree
n polynomial with coefficients in Zt .
Given the public key pk = (a0 , a1 ) and a message m ∈ Rq , the encryption algorithm samples
u ← χ, and f, g ← χ, and computes the ciphertext
ct = (c0 , c1 ) := (a0 u + tg + m, a1 u + tf )
SH.Mult(pk, ct0 , ct1 ): Let ct = (c0 , c1 , . . . , cδ ) and ct′ = (c′0 , c′1 , . . . , c′γ ) be the two ciphertexts.
Here, we do not pad either of the ciphertexts with zeroes.
Let v be a symbolic variable and consider the expression
Xδ Xγ
( ci v i ) · ( c′i v i )
i=0 i=0
δ
! γ
! δ+γ
X X X
i
ci v · c′i v i ≡ ĉi v i . (1)
i=0 i=0 i=0
Theorem 3. The encryption scheme SHE is correct, and can compute D multiplications followed
by A additions, assuming that
√ √
q ≥ 4 · (2tσ 2 n)D+1 · (2n)D/2 · A (2)
The encryption scheme SHE is secure under the Ring LWE assumption with parameters n, q and
χ.
P
from Equation 3 and by the definition of c2 := i c2,i ti .
This means that
2
crelin
0 + crelin
1 s = c0 + c1 s + c2 s − terelin
thus maintaining the invariant and achieving correctness of decryption if the final error emult − erelin
is small enough. Note that the relinearization process adds a fixed amount of error to the ciphertext,
and does not accumulate error multiplicatively.
On the one hand, relinearization reduces the length of the ciphertext considerably. On the flip
side, the public parameters become much larger. They now consist of an additional logt q ring
elements, totaling to logt q · n lg q = n(lg q)2 / lg t bits. Relinearization also affects the running time
of the homomorphic multiplication. In particular, one needs to additionally perform roughly logt q
polynomial multiplications and additions. These (side-)effects are most pronounced for small t,
where our experiments indicate considerable overhead. Quite encouragingly, though, the benefits
of relinearization seem to dominate the side-effects for large t (see Section 5 for more details).
The security of the encryption scheme given the homomorphism keys relies on the circular
security of the encryption scheme when encrypting quadratic functions of the secret key.
The ease of performing homomorphic operations depends crucially on the specific message-encoding
used in the ciphertexts. Consider the following two examples.
We describe two tricks for encoding messages. The first trick shows how to efficiently encode
integers in a ciphertext so as to enable efficient computation of their sums and products over
the integers. This is useful in computing the mean, the standard deviation and other private
statistics efficiently. The second trick shows how to “pack” n encryptions of bits into a single
encryption of the n-bit string. Some homomorphic operations, e.g., comparison of integers or
private information retrieval, seem to require bit-wise encryptions of the input. Once the answers
are computed, though, they can be packed into a single encryption using this trick.
Given a list of integers (m1 , . . . , mℓ ) ∈ Zℓ , if our goal is to compute their sum or product over
the integers homomorphically, the obvious (and sub-optimal) choice is to encrypt them directly.
Namely, for every m in the list, compute
We show a method of encrypting integers more efficiently by encoding them in the polynomial
ring, in essence enabling a smaller choice of t and better efficiency. In particular, for small enough
mi < 2n , we show that it suffices to choose t > ℓ in order to add ℓ integers. Being able to work
with a small t in turn enables us to choose other parameters, e.g., q and n to be correspondingly
smaller.
The idea is very simple:Pbreak each m into (at most n) bits (m(0) , . . . , m(n−1) ), create a degree-
(n-1) polynomial pm(x) = j m(j) xj and encrypt m as
Adding these encryptions adds up the polynomials pmi (x) coefficient-wise. Note that each co-
efficient was a single bit to start with, and a sum ℓ of them grows to at most ℓ. As long as
q > t > ℓ, this
P does not wrap around modulo t and upon decryption, we in fact get the polynomial
pmadd (x) = i pmi (x) over Z[x]. Now, the result is simply pmadd (2).
Extending this idea to support multiplication is a bit trickier. The problem stems from the fact
that the product of two polynomials pm(x) and pm′ (x) in general has a larger degree than each of
the original polynomials. If their original degree was close to n to start with, we will only be able
to obtain pm(x)pm′ (x) (mod xn + 1) upon decryption, which loses information about the product.
The solution is to encode the messages m as polynomials of degree at most n/d, if we anticipate
performing d multiplications. For our applications (e.g., computing standard deviations), this is
an acceptable trade-off since we only anticipate doing a single multiplication (or, at most a small
number of them in the case of computing higher-order regression functions).
encrypts the polynomial b(x) = b0 + . . . + bn−1 xn−1 . (It is equally easy to do this with homomor-
phically evaluated – and thus, potentially longer – ciphertexts as well).
In contrast, it seems much harder to unpack a ciphertext. Namely, transform a ciphertext that
encodes the polynomial b(x) = b0 + . . . + bn−1 xn−1 into n separate ciphertexts that encode the bits
bi . This is a useful thing to do when the homomorphic computation demands that the messages
be encrypted bit-wise, forcing the client to send many ciphertexts, one for each bit. If we had a
technique for unpacking bits, we could have the client send a single ciphertext, unpack it at the
server’s end, have the server perform computations, and finally, pack the result into one ciphertext
to send it back.
5 Implementation Details
We have implemented the somewhat homomorphic public key encryption scheme in the computer
algebra system magma [BCP97] and ran experiments on an Intel Core 2 Duo processor at 2.1
GHz. We use magma’s polynomial arithmetic for all computations in Rq , in particular we use
magma’s addition and multiplication of polynomials over Zq modulo xn + 1.
The
p optimal value of δ (and thus, the optimal running time of the attack) is achieved for m =
n log q/ log δ which gives us the following relation between q, n and δ:
√
c · q/s = 22 n log q log δ
. (5)
from [LP11] lets us determine the running time of attacks for various parameter settings.
system requires the polynomial f (x) to be cyclotomic of form xn + 1, we are constrained to choose
n to be a power of two. In the first of the two rows, we set n = 2048 and in the second, we set
n = 4096, the next possible choice. The security, measured as the logarithm of the running time of
the distinguishing attack, jumps from lg(T ) = 64 to lg(T ) = 218 when n goes from 2048 to 4096.
In other words, suppose we require 128 bits of security for the system, we are constrained to one
of two choices – set n = 2048 (and risk the possibility of better attacks), or set n = 4096 (and
settle for worse efficiency). This conundrum arises due to the constraint on n being a power of
two, which can potentially be removed by working with general cyclotomics (i.e., not of the form
xn + 1). Smart and Vercauteren [SV11] provide additional motivations for such generalization.
In Table 2, we provide running times for key generation, encryption, decryption and homo-
morphic addition and multiplication for various parameters. For SH.Enc, we distinguish the case
where sampling from the discrete Gaussian χ is included in the measurement and the case where it
is done as precomputation. For SH.Dec we give timings for decrypting ciphertexts of degree 1 and
of degree 2. The two columns with timings for SH.Mult correspond to multiplication of degree-1
ciphertexts with and without relinearization.
Mean and variance computation. To compute the mean, we do not need any multiplications, just
additions of ciphertexts, i.e. the maximal degree of ciphertext we need is D = 1. We used the
parameters from Table 1 with t = 1024, D = 1 and n = 1024. The corresponding 30-bit prime is
q = 1061093377 and has been chosen so as to support up to 1000 additions. We do not compute
the ciphertext of the mean, but of the sum of all numbers instead together with a ciphertext
encrypting the number of numbers that have been added. The mean can then easily be computed
by one division after decryption. Computing the ciphertext for the sum of 100 numbers of size
128-bits from the single ciphertexts takes about 20ms.
Computation of the variance requires one multiplication. Suitable parameters are given in
Table 1 as t = 1024, D = 2, and n = 2048 with a 58-bit prime q = 144115188076060673. To obtain
the ciphertexts for the sum and sum of squares that can be used to determine mean and variance
takes about 6s.
Potential Improvements. We remark that our implementation uses the generic polynomial arith-
metic in magma. A number of performance optimizations are possible; we mention one such
possibility. The encryption scheme uses addition and multiplication of polynomials over Zq mod-
ulo xn + 1, where n is a power of two and q = 1 (mod 2n). However, the particular choice of n and
q could allow for much faster implementations than the generic magma code. Such optimizations
have already been considered in the context of hash functions (e.g., SWIFFT [LMPR08]) that use
fast Fourier-transform techniques to speed up computations.
is not homomorphic at all). The main observation is that the steps of AES decryption can all
be carried out on FHE-encrypted entries. A one time set-up cost is that the client uploads the
FHE-encryption of its AES secret key K:
”Client sends FHE(K) to Cloud”
Then for each piece of content m to be uploaded to the cloud, the client uploads only the AES-
encryption of m to the cloud, encrypted under its own secret key K.
”Client sends AESK (m) to Cloud”
Now the cloud is expected to operate on the inputs it receives for the client and compute and return
FHE-encryptions of functions of those inputs. In order to do that, the cloud must first compute
the FHE-encryption of m: in other words the cloud computes the public key FHE-encryption of
the AES encryption of the content, FHE(AESK (m)), and must now unravel the AES encryption
inside the FHE encryption to obtain FHE(m). Once this is done, the cloud computes the FHE
encryption of f (m), for the appropriate function f .
There is still a snag in this solution, namely that the resulting ciphertext that the server re-
turns to the client is still a large FHE ciphertext. The solution to this is the dimension reduction
technique introduced by [BV11a]. In particular, the dimension reduction technique converts a
ciphertext in Zq [x]/ hxn + 1i (where both
n and q are large in order to support expressive ho-
momorphisms) to a ciphertext in Zp [x]/ xk + 1 , where both k and p are small. The resulting
ciphertext encrypts the same message, although it does not support any further homomorphisms.
The server then applies this transformation and sends the resulting short ciphertext to the client.
In short, all the communication over the network consists of short, non-homomorphic cipher-
texts. At the server’s end, the ciphertexts are first “upgraded” to homomorphic ciphertexts which
are then computed on, and finally “downgraded” to short non-homomorphic ciphertexts which are
then sent to the client.
D
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Fig. 1. Graphical representation of part of the data in the last three columns of Table 1 for t = 1024,
giving the size lRq of a general element in Rq , public key size, original ciphertext size (both 2 · lRq ) and
public key size including the parameters for the relinearization step.
7 Conclusion
In answer to the question of whether homomorphic encryption can be practical, we give several
concrete applications to useful cloud computing scenarios where only somewhat homomorphic en-
Can Homomorphic Encryption be Practical? 15
Table 1. Example parameters and cost of the distinguishing attack from [LP11] for distinguishing ad-
vantage ǫ = 2−32 , i.e. c ≈ 2.657, modulus t for the message space Rt , maximal ciphertext degree D,
size of prime q, Hermite root factor δ, and logarithm of the runtime lg(T ). We also give the bitlength
lRq = n · ⌈lg(q)⌉ of an element from Rq and the bitlength 2 · lRq of the public key and an original cipher-
text that both consist of 2 elements. The last column gives the size of the public key together with the
logt q public elements used for the relinearization technique described in Section 3.2. The entries in the
last three columns are given in multiples of 103 bits and are rounded up to the next such multiple.
16 Kristin Lauter, Michael Naehrig, and Vinod Vaikuntanathan
Table 2. Timings for the somewhat homomorphic encryption scheme using the example parameters given
in Table 1. The column labeled Sχ gives timing for sampling an element from the discrete Gaussian
distribution χ. In the second column for SH.Enc, labeled prec., encryption is measured without sampling
from χ, which is instead done as a precomputation. The two columns for SH.Dec correspond to decryption
of a degree-1 and a degree-2 ciphertext, respectively. The last column gives the time taken for a ciphertext
multiplication of two linear ciphertexts including the degree reduction resulting in a degree-1 ciphertext
for the product. Measurements were done on a 2.1 GHz Intel Core 2 Duo using the computer algebra
system Magma [BCP97].
Can Homomorphic Encryption be Practical? 17
ut
SH.Mult
s
3
bc
SH.Enc
2 (precomp.)
ut
bc
rs
1 SH.Dec
rs (deg 1)
ut
ut bc
utbc bcrs rs
rsbc utrsbc rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 D
Fig. 2. Graphical representation of part of the timing data in Table 2 for t = 1024, giving the time for
encryption SH.Enc when sampling from the discrete Gaussian distribution χ is done as a precomputation,
the time for decryption SH.Dec of a ciphertext of degree 1, and the time for multiplication SH.Mult of two
ciphertexts of degree 1.
cryption is required, and we give performance numbers based on our Magma implementation of
the new scheme of [BV11b]. The scenarios we present are such that outsourced computation is
actually valuable. That is, the cloud service may collect encrypted data from multiple sources and
do computation on that data before providing useful encrypted content back to the user. Precise
performance data was given in Section 5, but it is worthwhile to highlight here a sample of the
results. We showed that an encryption for the sum of 100 128-bit numbers can be computed from
the individual ciphertexts in 20 milliseconds on a laptop running Magma. We noted that compu-
tation of the variance requires one multiplication and taking suitable parameters from Table 1,
we found that for t = 1024, n = 2048, and a 58-bit prime q, ciphertexts for the sum and sum of
squares can be computed in about 6 seconds.
Acknowledgments. We would like to thank Daniele Miccicancio for valuable comments.
References
[ACPS09] Benny Applebaum, David Cash, Chris Peikert, and Amit Sahai. Fast cryptographic primi-
tives and circular-secure encryption based on hard learning problems. In Shai Halevi, editor,
CRYPTO, volume 5677 of Lecture Notes in Computer Science, pages 595–618. Springer, 2009.
[BCHL09] Josh Benaloh, Melissa Chase, Eric Horvitz, Kristin Lauter. Patient-controlled encryption:
patient privacy in electronic medical records. In Proceedings of the 2009 ACM workshop on
Cloud computing security.
[BCP97] Wieb Bosma, John Cannon, and Catherine Playoust. The Magma algebra system I: The user
language. J. Symbolic Comput., 24(3-4):235–265, 1997. Computational algebra and number
theory (London, 1993).
[BGN05] Dan Boneh, Eu-Jin Goh, and Kobbi Nissim. Evaluating 2-DNF formulas on ciphertexts. In
Theory of Cryptography - TCC’05, volume 3378 of Lecture Notes in Computer Science, pages
325–341. Springer, 2005.
[BV11a] Zvika Brakerski and Vinod Vaikuntanathan. Efficient fully homomorphic encryption from
(standard) LWE. FOCS, 2011.
[BV11b] Zvika Brakerski and Vinod Vaikuntanathan. Fully homomorphic encryption from ring-LWE
and security for key dependent messages. CRYPTO 2011, 2011.
[CF85] Josh D. Cohen and Michael J. Fischer. A robust and verifiable cryptographically secure election
scheme (extended abstract). In FOCS, pages 372–382. IEEE, 1985.
18 Kristin Lauter, Michael Naehrig, and Vinod Vaikuntanathan
[DGHV10] Marten van Dijk, Craig Gentry, Shai Halevi, and Vinod Vaikuntanathan. Fully homomorphic
encryption over the integers. In EUROCRYPT 2010, pages 24–43.
[El-84] Taher El-Gamal. A public key cryptosystem and a signature scheme based on discrete loga-
rithms. In CRYPTO, pages 10–18, 1984.
[Fre10] David Mandell Freeman. Converting pairing-based cryptosystems from composite-order groups
to prime-order groups. In EUROCRYPT 2010, pages 44–61.
[Gen09] Craig Gentry. Fully homomorphic encryption using ideal lattices. In Michael Mitzenmacher,
editor, STOC, pages 169–178. ACM, 2009.
[Gen10] Craig Gentry. Toward basing fully homomorphic encryption on worst-case hardness. In Tal
Rabin, editor, CRYPTO, volume 6223 of Lecture Notes in Computer Science, pages 116–137.
Springer, 2010.
[GH11] Craig Gentry and Shai Halevi. Implementing Gentry’s fully-homomorphic encryption scheme.
In EUROCRYPT, 2011. (To appear).
[GM82] Shafi Goldwasser and Silvio Micali. Probabilistic encryption and how to play mental poker
keeping secret all partial information. In STOC, pages 365–377. ACM, 1982.
[GN08] Nicolas Gama and Phong Q. Nguyen. Predicting lattice reduction. In Nigel P. Smart, editor,
EUROCRYPT, volume 4965 of Lecture Notes in Computer Science, pages 31–51. Springer,
2008.
[LM06] Vadim Lyubashevsky and Daniele Micciancio. Generalized compact knapsacks are collision
resistant. In Michele Bugliesi, Bart Preneel, Vladimiro Sassone, and Ingo Wegener, editors,
ICALP (2), volume 4052 of Lecture Notes in Computer Science, pages 144–155. Springer, 2006.
[LMPR08] Vadim Lyubashevsky, Daniele Micciancio, Chris Peikert, and Alon Rosen. Swifft: A modest
proposal for FFT hashing. In Kaisa Nyberg, editor, FSE, volume 5086 of Lecture Notes in
Computer Science, pages 54–72. Springer, 2008.
[LP11] Richard Lindner and Chris Peikert. Better key sizes (and attacks) for LWE-based encryption.
In Aggelos Kiayias, editor, CT-RSA, volume 6558 of Lecture Notes in Computer Science, pages
319–339. Springer, 2011.
[LPR10] Vadim Lyubashevsky, Chris Peikert, and Oded Regev. On ideal lattices and learning with
errors over rings. In Eurocrypt 2010, pages 1–23. Draft of full version was provided by the
authors.
[LV01] Arjen K. Lenstra and Eric R. Verheul. Selecting cryptographic key sizes. J. Cryptology,
14(4):255–293, 2001.
[MR07] Daniele Micciancio and Oded Regev. Worst-case to average-case reductions based on gaussian
measures. SIAM J. Comput., 37(1):267–302, 2007.
[MR09] Daniele Micciancio and Oded Regev. Lattice-based cryptography. In Post-Quantum Cryptog-
raphy. Springer, 2009.
[Pai99] Pascal Paillier. Public-key cryptosystems based on composite degree residuosity classes. In
EUROCRYPT, pages 223–238, 1999.
[RS10] Markus Rückert and Michael Schneider. Estimating the security of lattice-based cryptosystems.
Cryptology ePrint Archive, Report 2010/137, 2010. http://eprint.iacr.org/2010/137.
[SS10] Damien Stehlé and Ron Steinfeld. Faster fully homomorphic encryption. In Masayuki Abe, edi-
tor, ASIACRYPT, volume 6477 of Lecture Notes in Computer Science, pages 377–394. Springer,
2010.
[SV10] Nigel P. Smart and Frederik Vercauteren. Fully homomorphic encryption with relatively small
key and ciphertext sizes. In Phong Q. Nguyen and David Pointcheval, editors, Public Key
Cryptography, volume 6056 of Lecture Notes in Computer Science, pages 420–443. Springer,
2010.
[SV11] N.P. Smart and F. Vercauteren. Fully homomorphic SIMD operations. Cryptology ePrint
Archive, Report 2011/133, 2011. http://eprint.iacr.org/2011/133.