Galois keys are a specialized type of key-switching key in schemes like BFV, BGV, and CKKS that enable homomorphic automorphisms—specifically, the cyclic rotation of the plaintext slots packed inside a single ciphertext. Without these keys, the evaluator can only perform element-wise addition and multiplication on the packed vector; Galois keys unlock the ability to shift elements left or right, which is essential for implementing the data movement patterns required by linear algebra operations in the encrypted domain.
Glossary
Galois Keys

What is Galois Keys?
Galois keys are public evaluation keys in homomorphic encryption that enable the cyclic rotation of data slots within a packed ciphertext, a critical operation for implementing convolution and matrix multiplication on encrypted data.
Generated by the secret key owner and shared with the computation server, Galois keys enable operations like rotating a vector by k positions while consuming a portion of the noise budget. In practice, a separate key is required for each distinct rotation index needed by the circuit, and these keys are fundamental to evaluating convolutional neural network layers and matrix transpositions under encryption, where data must be systematically realigned to perform dot products between weights and inputs.
Key Properties of Galois Keys
Galois keys are public evaluation keys that enable homomorphic rotation of the slots within a packed ciphertext. They are the essential cryptographic mechanism for implementing convolutions, matrix transpositions, and data shuffling in the encrypted domain without decryption.
Slot Rotation Mechanics
Galois keys enable cyclic rotations of the plaintext slots encoded within a single RLWE ciphertext. A rotation by k positions shifts each slot value to slot i+k mod n.
- Left Rotation: Shifts slots toward the most significant position
- Right Rotation: Shifts slots toward the least significant position
- Arbitrary Step Sizes: Any integer step
kcan be evaluated, provided the corresponding key has been generated
The operation applies a specific automorphism to the underlying ring element, mapping a(X) to a(X^k) modulo the cyclotomic polynomial. This preserves the encrypted state while rearranging the logical data layout.
Convolution via Rotation
In encrypted neural networks, convolution operations are implemented using Galois rotations and element-wise multiplication. For a filter of size f, the process requires:
- Rotate the input ciphertext by each offset position in the filter
- Multiply each rotated ciphertext by the corresponding plaintext filter weight
- Accumulate all resulting ciphertexts via homomorphic addition
This transforms a spatial convolution into a series of SIMD-friendly operations. The number of rotations scales linearly with the filter size, making Galois key selection a critical performance parameter for CNN inference under FHE.
Matrix Multiplication Support
Galois keys enable efficient encrypted matrix multiplication by supporting row-major to column-major transformations and diagonal extraction patterns.
- Row Rotation: Shifts entire rows within the packed matrix representation
- Column Extraction: Uses specific rotation patterns to isolate columns for dot-product computation
- Transposition: Achieved through a sequence of structured rotations and masking operations
This capability is fundamental for implementing fully connected layers and attention mechanisms in transformer architectures operating on encrypted data. The choice of encoding (row-packed vs. column-packed) determines the exact rotation schedule required.
Key Generation & Distribution
Galois keys are generated by the data owner using their secret key and published as part of the public evaluation key set. Each distinct rotation step k requires a separate key.
- Key Material: A Galois key is a special key-switching key that transforms a ciphertext under
s(X^k)back tos(X) - Storage Cost: Each key is approximately the size of a relinearization key, typically several megabytes
- Security Property: Possession of Galois keys does not enable decryption; they only permit slot permutation
The set of required rotation indices must be determined before computation begins, as generating new keys requires access to the secret key.
Relationship to Key Switching
Galois rotation is a specific instance of the key switching primitive. The operation transforms a ciphertext encrypted under the automorphed secret key s' = s(X^k) back to the original secret key s(X).
- Underlying Mechanism: Identical to the key switching used in relinearization and modulus switching
- Decomposition Base: The key switching decomposition base affects both noise growth and computational cost
- Noise Addition: Each rotation adds a small, additive noise term proportional to the decomposition parameters
This shared mechanism means optimizations to key switching (such as hybrid key switching or GPU acceleration) directly benefit Galois rotation performance.
Performance Considerations
Galois rotations are among the most expensive operations in HE computation, typically dominating the runtime of encrypted CNN inference.
- NTT Operations: Each rotation requires multiple Number Theoretic Transform passes
- Key Count Trade-off: Generating more keys increases storage but reduces online computation by avoiding rotation decomposition
- Decomposition Strategy: A rotation by
kcan be decomposed into a sequence of rotations by powers of two, trading key count for latency - Hardware Acceleration: Modern FHE libraries leverage GPU and FPGA acceleration specifically for the NTT-heavy rotation kernel
Optimal key selection is a storage-computation trade-off that must be tuned per model architecture.
Frequently Asked Questions
Clear answers to the most common technical questions about Galois keys, their role in homomorphic encryption, and how they enable critical operations like ciphertext rotation for encrypted computation.
Galois keys are a specific type of public evaluation key in Ring Learning With Errors (RLWE)-based homomorphic encryption schemes that enable the homomorphic rotation of the slots within a packed ciphertext. They are generated by the data owner during the key generation phase and shared with the computation server. Without Galois keys, the server can only perform addition and multiplication on ciphertexts; with them, the server gains the ability to cyclically shift the underlying plaintext vector elements. This rotation is essential for implementing matrix multiplication, convolution operations, and general data movement patterns required by neural network inference in the encrypted domain. Each distinct rotation step (e.g., rotate left by 1, rotate right by 3) typically requires its own corresponding Galois key, creating a trade-off between computational flexibility and the size of the public key material that must be transmitted and stored.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Core cryptographic operations and data structures that interact with Galois keys to enable efficient encrypted computation.
Ciphertext Packing
A technique that encodes multiple plaintext values into a single ciphertext, enabling SIMD parallelism. Galois keys are the cryptographic mechanism that allows individual slots within this packed structure to be rotated and permuted without decryption.
- Encodes vectors of up to 2^15 values in a single ciphertext
- Amortizes computation cost across thousands of operations
- Requires Galois keys for any non-trivial data movement between slots
Key Switching
A cryptographic operation that transforms a ciphertext encrypted under one secret key into a ciphertext encrypting the same message under a different secret key. Galois keys are a specialized form of key-switching key that enable automorphic mappings on polynomial rings.
- Underlies relinearization, rotation, and conjugation
- Requires publishing evaluation keys without compromising the secret key
- Computational cost scales with the size of the key-switching key matrix
Relinearization
A key-switching procedure that reduces a ciphertext after multiplication back to two ring elements, preventing quadratic growth in ciphertext dimension. Uses a relinearization key (a type of evaluation key) to convert the quadratic term.
- Without relinearization, each multiplication triples ciphertext size
- Essential for deep circuits like neural network inference
- Shares underlying mathematical structure with Galois key operations
SIMD Operations
The ability to perform a single homomorphic operation on a packed ciphertext that simultaneously applies to all encoded plaintext slots. Galois keys unlock the full potential of SIMD by enabling cross-slot data movement.
- Addition and multiplication are natively SIMD-parallel
- Convolution requires Galois rotations to align filter weights with input patches
- Achieves amortized throughput of thousands of operations per ciphertext operation
CKKS Scheme
A leveled homomorphic encryption scheme optimized for approximate fixed-point arithmetic on real numbers. CKKS heavily relies on Galois keys for implementing matrix multiplication and convolution in encrypted neural networks.
- Supports rescaling to manage precision after multiplication
- Native packing of complex numbers into ciphertext slots
- Galois rotations enable efficient dot product computation across packed weight matrices

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us