You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: encryption-decryption/browser/README.md
+7-3
Original file line number
Diff line number
Diff line change
@@ -33,15 +33,19 @@ Before you click the buttons, open up the JavaScript console in your browser so
33
33
After typing in the text you want to encrypt, clicking the `Encrypt String` button will:
34
34
35
35
1. You will be prompted by your wallet (i.e. MetaMask) to connect an account to the site
36
-
2. After connecting an account, the console should display a successful connection to the Lit network and the encrypted `ciphertext` and `dataToEncryptHash` that will later be used to decrypt the string.
36
+
2. After connecting an account, the console should display a successful connection to the Lit network and the encrypted `ciphertext` and `dataToEncryptHash` that will later be used to decrypt the string
37
37
38
38
After encrypting the string, clicking the `Decrypt String` button will:
39
39
40
40
1. Connect you to the Lit network and LitContracts client
41
41
2. If you did not provide a Capacity Credit token ID, you will be prompted by your wallet to mint a new one
42
-
3. You will then be prompted by your wallet to sign a message. This message will create a `capacityDelegationAuthSig`, which is used to pay for decrypting data ([and other functionality](https://developer.litprotocol.com/paying-for-lit/capacity-credits)) on the Lit
42
+
3. You will then be prompted by your wallet to sign a message. This message will create a `capacityDelegationAuthSig`, which is used to pay for decrypting data ([and other functionality](https://developer.litprotocol.com/paying-for-lit/capacity-credits)) on the Lit network
43
43
4. You will then be prompted by your wallet to sign another one final message. This message is the SIWE message that will derive your address from to use for the conditional check of whether or not you are permitted to decrypt the data
Copy file name to clipboardExpand all lines: encryption-decryption/nodejs/README.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -36,31 +36,31 @@ In this directory, `encryption-decryption/nodejs`, run `yarn test:encrypt` to te
36
36
37
37
`encryptFile.ts`:
38
38
39
-
1.Will take a blob created from a file and contract conditions to encrypt the file.
39
+
1.Requires a blob created from a file and contract conditions to encrypt the file
40
40
2. Connects to the Lit network
41
41
3. Encrypts the file and returns the `ciphertext` and `dataToEncryptHash`
42
42
43
43
`decryptFile.ts`:
44
44
45
45
1. Connects to the Lit network and LitContracts client
46
-
2. Mints a new CapacityCredit if a CapacityCredit tokenId is not provided in the `.env` file and creates a capacityDelegationAuthSig to pay for use of the Lit network, decrypting data in this case
46
+
2. Mints a new CapacityCredit if a CapacityCredit tokenId is not provided in the `.env` file and creates a capacityDelegationAuthSig to pay for use of the Lit network, which is decrypting data in this case
47
47
3. Generates session signatures with the ability to decrypt the file
48
48
4. Decrypts the file and returns a decrypted file buffer
49
49
50
-
However the tests created in the `test` directory are more complicated.
50
+
The tests created in the `test` directory are slightly more complex.
51
51
52
-
`encryptFileWithContractConditions.spec.ts`
52
+
`encryptFileWithContractConditions.spec.ts`:
53
53
54
54
```
55
55
yarn test:encrypt
56
56
```
57
57
58
-
Encrypt the file with specific `EVMContractConditions`. These conditions check the [deployedAllowList](./test/fixtures/deployed.json) contract address on the Chronicle Yellowstone network and calls the `isOnAllowList` function, expecting to return true if the address of the Ethereum account is on the allow list.
58
+
Encrypt the file with specific `EVMContractConditions`. These conditions check the [deployedAllowList](./test/fixtures/deployed.json) contract address on the Chronicle Yellowstone network and calls the `isOnAllowList` function, expecting to return true if the address of the Ethereum account is on the allow list. This means that the encrypted file can only be decrypted if the same contract conditions are able to return true while decrypting.
59
59
60
-
`decryptFileWithContractConditions.spec.ts`
60
+
`decryptFileWithContractConditions.spec.ts`:
61
61
62
62
```
63
63
yarn test:decrypt
64
64
```
65
65
66
-
Decrypts the file, first checking if the address is on the allow list, and if not, adding it to the allow list. Once the address is on the allow list, the file can be successfully decrypted.
66
+
Decrypts the file, first checking if the address is on the allow list, and if not, adding it to the allow list. Once the address is on the allow list, the file can be successfully decrypted.
0 commit comments