Skip to main content

Algebraic Cipher Types: Computing on Encrypted Data While Preserving Structure

Computing on encrypted data without decrypting it. Not just simple operations, but preserving the full algebraic structure of the computation.

That’s the idea behind algebraic cipher types: a framework for secure computation built on category theory and abstract algebra.

The Fundamental Problem

Traditional encryption forces a choice:

  • Decrypt then compute then encrypt (exposes plaintext)
  • Encrypt then… you can’t compute meaningfully

Homomorphic encryption tries to bridge this gap, but existing approaches are limited to specific algebraic structures, are ad-hoc constructions for each use case, lack compositionality, and are hard to reason about formally.

The Functorial Solution

We introduce the cipher functor c_A: a systematic construction that lifts algebraic structure into the encrypted domain.

Algebraic Structure (S, *, e)
           | c_A (cipher functor)
           v
Encrypted Structure (E, +, e')

Key property: Operations in the encrypted domain correspond exactly to operations in the plaintext domain.

What This Means

If you have a monoid (S, *, e):

  • Elements: a, b in S
  • Operation: a * b
  • Identity: e

The cipher functor gives you (E, +, e') where:

  • Encrypted elements: [a], [b] in E
  • Encrypted operation: [a] + [b] = [a * b]
  • Encrypted identity: e' = [e]

You can compute on ciphertexts exactly as if they were plaintexts. The algebraic laws carry over.

Category Theory in Practice

The functorial approach buys you three things:

1. Preservation of Structure

F(f . g) = F(f) . F(g)    # Composition preserved
F(id) = id                 # Identity preserved

2. Natural Transformations

Operations between structures lift automatically:

phi: (S1, *1) -> (S2, *2)
         |
         v
[phi]: (E1, +1) -> (E2, +2)

3. Universal Properties

Guarantees about what can and cannot be computed securely.

Beyond Monoids

The framework extends to:

  • Groups: Full invertibility in the encrypted domain
  • Rings: Both addition and multiplication
  • Lattices: Ordered structures
  • Categories: Arbitrary algebraic theories

Practical Applications

Secure Multi-Party Computation

# Parties hold encrypted shares
shares = [encrypt(x1), encrypt(x2), encrypt(x3)]

# Compute on encrypted data
encrypted_sum = reduce(cipher_add, shares)

# Only final result is decrypted
result = decrypt(encrypted_sum)  # = x1 + x2 + x3

Private Database Queries

# Query database without revealing query
encrypted_query = encrypt(search_term)
encrypted_result = db.search(encrypted_query)
result = decrypt(encrypted_result)

Oblivious Algorithms

# Sort encrypted data without revealing order
encrypted_list = [encrypt(x) for x in data]
encrypted_sorted = cipher_sort(encrypted_list)
# Sorted order revealed only to authorized party

Security Guarantees

The functorial construction provides:

  • Semantic security: Ciphertexts reveal nothing about plaintexts
  • Non-malleability: Operations cannot be tampered with
  • Compositionality: Complex systems proven secure from component properties

Performance Considerations

There are real tradeoffs:

  • Stronger guarantees cost more computation
  • Richer algebraic structures produce larger ciphertexts
  • Generic constructions may be less efficient than specialized schemes

The paper analyzes these tradeoffs and provides optimization techniques.

Read the Full Paper

For the mathematical foundations, security proofs, and implementation details:

View Paper

Topics covered:

  • Formal category-theoretic framework
  • Security definitions and proofs
  • Construction for various algebraic structures
  • Performance analysis and benchmarks
  • Comparison with existing homomorphic schemes
  • Applications to real-world problems

Discussion