Skip to content

flyingnobita/0xparc_intro_book_workbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction to Programmable Cryptography Workbook

This is a workbook for 0xPARC's Introduction to Programmable Cryptography (PDF) book. Its main objective is to help readers follow the book and its concepts. The Jupyter Notebooks directly translate the algorithms and examples mentioned in the book, written in the most straightforward manner possible (i.e., no optimizations).

For Chapter 4, please refer to 0xPARC's PlonKathon which contains related exercises. You can also see my PlonKathon blog post for hints.

Acknowledgement

Thank you to the book's authors, Evan Chen and Brian Lawrence for their feedback. Thank you to 0xPARC for sponsoring this project.

Running Online

Open notebooks on Binder

Running Locally

How To Install

Dependencies

This project's dependencies are managed by Poetry.

Install Poetry (if not already installed)
pipx install poetry

If the above doesn't work, see here for additional instructions on Poetry installation.

Install Dependencies with Poetry
poetry install

How To Run

All notebook files are in the src folder and can be run inside a Jupyter Lab environment.

To start JupyterLab:

jupyter-lab

Then open the jupyter notebook files inside the \src folder

How to Test

There are unittest files for certain chapters.

Run all test files:

poetry run pytest

Run test for specifc chapter:

poetry run pytest tests/test_ch_6_oram.py

Roadmap

  • Code companion to text
    • Ch 2: 2PC
      • 2.1.3 Garbled gates
      • 2.1.4 Chaining garbled gates
      • 2.1.5 How Bob uses one gate
        • Example: How to chain 2 garbled gates
      • 2.2.1 Commutative encryption
      • 2.2.3 OT in one step
        • Example: How to combine garbled circuits and OT
    • Ch 3: EC & PCS
      • 3.2.2 EdDSA Signature Scheme
      • 3.2.3 Pedersen Commitments
      • 3.4 KZG Commitments
    • Ch 5: FHE
      • 5.3 Public Key Cryptography from LWE Example
      • 5.4.3 The "Flatten" Operation
    • Ch 6: ORAM
      • 6.3 Binary Tree ORAM
      • 6.7 Path ORAM
      • Other Ideas:
        • 6.6 Recursive ORAM
        • Encryption and decryption on blocks
  • Exercises