---
# System prepended metadata

title: Secret Inputs Exchange

---

# Secret Inputs Exchange

### :information_source: Prover to Matching Engine

:::info
## Schemes used
### symetric encryption
aes-256-cbc

### asymetric encryption
key type: rsa2048
padding: RSA_PKCS1_OAEP_PADDING
oaepHash: sha1
:::
```plantuml
@startuml

skinparam monochrome true
skinparam shadowing false

title Encryption Scheme Overview

start

: **PROVER** |

split
    :Encrypt data using\n**AES-256-CBC**\nwith a random cipher|;
    note right: Encrypted Data
split again
    :Encrypt cipher using\n**RSA2048**|;
    note right: Encrypted Cipher\n(using public key of\nMATCHING_ENGINE)
end split

:Create **ACL_FILE** with\nEncrypted Cipher;

:Share both **Encrypted Data**\nand **ACL_FILE** onto **CELESTIA**;

stop

@enduml

```

### :information_source: Matching Engine to Generator

```plantuml
@startuml

skinparam monochrome true
skinparam shadowing false

title MATCHING_ENGINE Data Processing Overview

start

: **MATCHING_ENGINE** |

:Fetch encrypted data and\nACL from **CELESTIA**;

:Decrypt ACL to retrieve cipher;
note right: Only MATCHING_ENGINE\nhas the capability to\ndecrypt this ACL

:Decrypt encrypted data using the cipher\nretrieved above|;
note right: Actual Data

:Process the actual data;

:Encrypt the cipher using\n**GENERATOR's** public key|;
note right: New ACL created

:Publish the new ACL to **CELESTIA**;

stop

@enduml

```

### :information_source: Last Step i.e Generator generates proof and submits to smart contract

```plantuml
@startuml

skinparam monochrome true
skinparam shadowing false

title GENERATOR Proof Generation Overview

start

: **GENERATOR** |

:Fetch encrypted data and\nnew ACL generated by\nMATCHING_ENGINE from **CELESTIA**;

:Decrypt the data and ACL\nto retrieve secrets|;
note right: Actual Secrets

:Fetch public inputs from\nsmart contracts|;
note right: Public Inputs

:Generate proof using\nsecrets and public inputs|;
note right: Proof generated

stop

@enduml

```

:::danger
### When Migrated to Oyster, RSA pub/priv pair will be generated inside the oyster and published, For now generate one externally and use
:::