Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rav1kantsingh/4ca4605c1443c5d497a8eab0e326c865 to your computer and use it in GitHub Desktop.
Save rav1kantsingh/4ca4605c1443c5d497a8eab0e326c865 to your computer and use it in GitHub Desktop.

GSoC 2020

Google Summer of Code 2020 Final Work Report

Aim

To Implement Fan-Vercauteren Homomorphic Encryption scheme in PySyft and create a new tensor type which utilizes the scheme and can be used in deep learning environments.

A summary of the work I've done

1. Implemented FV Homomorphic encryption scheme from scratch in python.

The major part of my project was to implement the scheme from scratch in python so that we can utilize it without any dependency and the flexibility to update it as per our requirements.

2. Working on a new tensor type BFVTensor to utilise the scheme.

Creating a tensor type that uses the scheme and makes it usable in deep learning frameworks like Pytorch or Tensorflow.

About Homomorphic Encryption

Homomorphic encryption is a form of encryption with an additional evaluation capability for computing over encrypted data without access to the secret key. The result of such a computation remains encrypted. Homomorphic encryption can be viewed as an extension of either symmetric-key or public-key cryptography.

Pull Request for the Scheme

  1. PR for parameter generation, key generator, integer encoder, encrypter and decrypter This PR is quite huge and contains many fundamental components of the scheme, the reason of putting it all together in one PR was to verify everything works perfectly before merging the code into library and to verify that, I had to check the complete encryption decryption process is working perfectly.

  2. PR for Addition operation on FV scheme

  3. PR for Multiplication operation on FV scheme

  4. PR for Negation operation on FV scheme

  5. PR for Subtraction operation on FV scheme

  6. PR for Relinearization operation on FV Scheme

  7. PR for Parameter validation of FV scheme

  8. PR for changing the data-structure of context(holds params and some usefull pre-computation), changed from single context to chain of contexts

Note: Documentation and unit-tests were added along with the code in each PR.

Pull Request for the Tensor.

  1. PR for new Tensor type for FV scheme Still in progress.

Overall Status of project.

The FV homomorphic encryption scheme is complete and working, you can refer to either tests or my experimental notebook (might change in future). Currently, we can perform homomorphic encryption using the individual components on integers but my focus is to get it inside a tensor type which can utilize the scheme with deep learning frameworks.

Future Improvements

  • There is the scope of improvement in the parameter setting for the scheme.
  • There is the scope of improvement in generating cryptographically secure random numbers.
  • There is the scope of improvement in polynomial calculations, we can try with various open-source polynomial calculation libraries and also try implementing NTT architecture.
  • As the scheme is implemented internally in PySyft, we can try various optimization techniques directly on it.

Final Note

Google Summer of Code has been super exciting and challenging experience for me. I’ve learnt tonnes about Cryptography, privacy-preserving AI, Open Source and Software Development. My skills to find solutions for a problem has been greatly improved. My mentor Ayoub Benaissa and the members of Crypto-Team at OpenMined have been immensely helpful and have guided me throughout these three months.

I plan to continue working on this project and hopefully develop it to a state where using homomorphic encryption becomes very easy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment