Last Fall, I gave a series of lectures on secure computing (computing with encrypted or private data).
Here is some companion OCaml code that demonstrates these techniques: GitHub - xavierleroy/secure-computing: Examples of computing over encrypted or private data .
If you’re curious about homomorphic encryption, zero-knowledge proofs, secure multi-party computation, oblivious transfers, private set intersection and so on, you might enjoy these code examples and the explanations given in the lectures.
This code is probably insecure and not intended to be used in actual high-security applications. If you’re into this kind of things, see Belenios, an excellent e-voting system written in OCaml that uses many of these secure computing techniques.