encryption-zp cover

encryption-zp

Repo Repository

encryption-zp is a Scala implementation of Shamir’s Secret Sharing scheme over the finite field Z_p. It splits a secret into multiple shares distributed among participants and reconstructs it once enough of them are combined, following the threshold cryptography model.

Core operations

The project is organized as a set of pure, composable functions covering the full lifecycle of a secret:

Design

All arithmetic is performed with arbitrary-precision BigInt values to safely support secrets and primes ranging from toy-sized (20-bit) to cryptographically realistic sizes (2048-bit). The codebase separates generic modular-arithmetic utilities from the secret-sharing algorithms themselves, and includes a documented abstract data type for polynomials and shares, complexity analysis for the split and reconstruct operations, and an informal correctness proof traced through a concrete example.

Interface

A simple console menu lets the user split a secret message into shares or reconstruct a secret from a set of provided shares, printing the generated prime, the shares, and the result of the threshold verification.

Tech stack

Written in Scala, tested with ScalaTest across unit, edge-case, and scalability test suites for every core function.