---
# System prepended metadata

title: ECIES Github Issue for Grant

---

### Self Proposed Open Task: [Elliptic Curve Integrated Encryption Scheme (ECIES) Implementation in Circom]

#### Executive Summary
- Project Overview: Create a secure and efficient ECIES encryption system in Circom, with zero-knowledge proof features. The main goals are to build a working ECIES system in circom. and make it run smoothly with fewer computations.

#### Project Details
- Motivation:  ECIES is important for secure data sharing in blockchain and crypto projects. Building it in Circom helps advance zero-knowledge projects.
    - [complete spec sheet](https://hackmd.io/zGQFexzNR-2T4sW_trO8AQ)
- Scope of Work:
    1. Build the main parts of ECIES in Circom:
       - Optimising HMAC with SHA-256
       - Optimising AES encryption with CTR Mode
       - Key creation function (HKDF with SHA-256) in Circom
    2. Create ECIES encryption.
    3. Optimise ECIES in circom.
    4. Write thorough tests
    5. Publishing as npm packages
- Expected Outcomes:
  1. AES-Circom implementation with CTR mode
  2. HMAC with SHA-256 implementation in Circom
  3. HKDF with SHA-256 implementation in Circom
  4. Complete ECIES implementation in Circom

#### Qualifications

- Skills Required: 
  - TypeScript
  - Proficient in Circom
  - Understanding of ZKP and  Cryptography.

#### Team 👥:

- Vikas Rushi
    - Email: 0xvikas@gmail.com
    - Telegram: vikasrushi
    - Discord: vikasrushi
- Yashwanth Reddy
    - Email: yashdotreddy@gmail.com
    - Telegram: immabeyeet
    - Discord: immabeyeet
- Ayman 
    - Email: aymanshaik1015@gmail.com
    - Discord: nesopie

#### Team's Experience:

- Implemented [Generic AES Circom](https://github.com/crema-labs/aes-circom)
- Implemented First AES Circom [CTR Mode](https://github.com/crema-labs/aes-circom/blob/main/circuits/ctr.circom)
- Implemented [hmac with sha256](https://github.com/crema-labs/hmac-circom) in circom 
- Implemented[Circom ASN.1 Parser](https://github.com/zkemail/asn1-parser-circom)

Github: https://github.com/crema-labs
Portfolio: https://crema.sh/

#### Administrative Details
- Estimated Project Duration: 1 month
- Project Complexity: Medium, we already have most of the basic math worked out. But putting it into Circom and making it run fast is tricky.
- Total Estimated Working Hours: 120 hrs
- Full-time equivalent (FTE): 0.75
- Expected Start Date: August 11th, 2024.
- Expected End Date:  September 8th, 2024.

#### Timeline 
#### **Week 1**
| Task | Description | Time |
| --- | --- | --- |
| Research | Research on ECIES encryption scheme , its components and potential use cases | 2 day |
| Research | Enhance understanding of KDF functions and potential issues raised regarding HKDF in the past. | 1 day |
| Refactor | Refactor our AES implementation to be more suited for ECIES. | 1 day |
| Testing | Add more tests for the AES implementation according to NIST test vectors. | 1 day |
| Documentation | Update the documentation with the new changes. | 1 day |

#### **Week 2**

| Task | Description | Time |
| --- | --- | --- |
| Implementation  | Implement HMAC with SHA-256 | 1 day |
| Testing  | Testing HMAC with SHA-256 with NIST test vectors| 1 day |
| Implementation  | Implement HKDF with SHA-256 | 1 day |
| Testing  | Testing HKDF with SHA-256 | 1 day |
| Testing  | Test ECC operations for secp256k1 and secp256r1 | 2 day |

#### **Week 3**

| Task | Description | Time |
| --- | --- | --- |
| Implementation  | Implement ECIES encryption scheme | 1 day |
| Testing  | Testing ECIES encryption scheme | 1 day |
| Implementation  | Implement HMAC and HKDF for all key lengths | 2 day |
| Testing  | Testing HMAC and HKDF for all key lengths | 1 day |
| Documentation | Update the documentation with the new changes. | 1 day |
| Testing | Integration testing of all components | 1 day |

#### **Week 4** 
This is an optional week for any additional testing or for implementing ; Zanity, `A ZK Vanity Address Generator` which would serve as a practical example and a use case for ECIES encryption scheme.

#### Additional Information
- [ECIES](https://www.secg.org/sec1-v2.pdf)
- [Advanced Encryption Standard (AES)](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.197-upd1.pdf)
- [HMAC RFC 2104](https://datatracker.ietf.org/doc/html/rfc2104)
- [KDF]( https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-56Ar3.pdf)
