aditya/work/cryptovault mpc
2024  ·  TypeScript · Next.js · Cryptography · Secure MPC

CryptoVault-MPC

interactive Yao's Millionaire Problem and secure multi-party computation simulator built during research under Prof. Vadapalli.

most people who build software on top of cryptography just import a standard library, hash a password, and call it a day. they don't really know what's happening under the hood. i wanted to understand the actual math behind privacy-preserving computation, which led me to walk into prof. adithya vadapalli's cryptography lab at IIT Kanpur to ask for research work. secure multi-party computation (MPC) is this incredibly cool concept: how do two parties compute a function over their private inputs without ever showing those inputs to each other? the standard example is Yao's Millionaire Problem—two wealthy people want to know who is richer, but neither wants to disclose their net worth. we solve this using garbled circuits and oblivious transfer. a garbled circuit is essentially an encrypted truth table. the generator encrypts the gate outputs and sends them to the evaluator, who evaluates the circuit gate-by-gate. since the evaluator doesn't know the encryption keys for the inputs they didn't choose, and the generator doesn't know which keys the evaluator selected, the computation finishes without leaking any inputs. i built an interactive web simulator (linked below) that parses and evaluates MPC circuits directly in the browser. dealing with binary operations and gate evaluations in vanilla javascript was incredibly tedious, but seeing a circuit successfully compute without leaking private values made it all worth it.