# Noir component for Encryption

**URL:** <https://forum.aztec.network/t/noir-component-for-encryption/349>\
**Category:** Noir\
**Created:** [May 9, 2023, 3:19pm UTC](https://forum.aztec.network/t/noir-component-for-encryption/349 "2023-05-09T15:19:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![enrico.eth](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/enrico.eth/32/128_2.png) [@enrico.eth](https://forum.aztec.network/u/enrico.eth)\
**Post date:** [May 9, 2023, 3:19pm UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/1 "2023-05-09T15:19:52Z")

</div>

Hi!  
I’m exploring the opportunity of using Noir for an experiment. I’m wondering if there is any available gadget containing the primitives to perform:  
a) symmetric key encryption (no particular preference for a specific scheme)  
b) asymmetric key encryption (no particular preference for a specific scheme)

---

<div class="post-metadata">

**Author:** ![Savio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/savio/32/21_2.png) [@Savio](https://forum.aztec.network/u/Savio)\
**Post date:** [May 10, 2023, 7:43am UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/2 "2023-05-10T07:43:49Z")

</div>

We have a few [hashing primitives](https://github.com/noir-lang/noir/blob/master/noir_stdlib/src/) available but not encryption specifically atm.

How does the workflow of your experiment look like?

---

<div class="post-metadata">

**Author:** ![enrico.eth](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/enrico.eth/32/128_2.png) [@enrico.eth](https://forum.aztec.network/u/enrico.eth)\
**Post date:** [May 10, 2023, 1:26pm UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/3 "2023-05-10T13:26:36Z")

</div>

The component that regards encryption would be to:

- prove that a value committed is equal to a secret being encrypted with a symmetric key
- prove that a (different) value committed is equal to a secret being encrypted with an asymmetric key (public key)

---

<div class="post-metadata">

**Author:** ![Savio](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/savio/32/21_2.png) [@Savio](https://forum.aztec.network/u/Savio)\
**Post date:** [May 10, 2023, 3:34pm UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/4 "2023-05-10T15:34:32Z")

</div>

Would proving `hash(secret, ...)` + sharing the preimage with the decryptor sufficiently mimics what you aim to achieve, or must it strictly be an en/decryption scheme?

---

<div class="post-metadata">

**Author:** ![enrico.eth](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/enrico.eth/32/128_2.png) [@enrico.eth](https://forum.aztec.network/u/enrico.eth)\
**Post date:** [May 11, 2023, 11:04am UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/5 "2023-05-11T11:04:40Z")

</div>

Thanks for the reply. Actually from what I can tell, it must be an encryption/decryption scheme.

Do you have a library that contains all these reusable primitives? Would it be something worth adding to it?

---

<div class="post-metadata">

**Author:** ![joshc](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.aztec.network/joshc/32/20_2.png) [@joshc](https://forum.aztec.network/u/joshc)\
**Post date:** [May 12, 2023, 12:52pm UTC](https://forum.aztec.network/t/noir-component-for-encryption/349/6 "2023-05-12T12:52:27Z")

</div>

We don’t currently have such a library. Would you be interested in creating one? We’d be happy to help with technical and financial support via our grants program. You can learn more about it here.

> **[Aztec Labs Grants | ZK Grants: Fund Your ZK Project](https://aztec.network/grants/)**
>
> ZK Grants: Fund your ZK project. Build cool stuff using Noir and Aztec, and we’ll fund it. Privacy-first applications in the Ethereum ecosystem now have a funding mechanism.
