> For the complete documentation index, see [llms.txt](https://wiki.4thtech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.4thtech.io/developers/architecture/security.md).

# Security notes

What Encryptor stores, where, how it is protected and what each permission is used for.

{% hint style="info" %}
**Status: Production-ready, stable.** Encryptor is supported; no new features are planned. Last update: 18 Apr 2024 (version 0.1.0).
{% endhint %}

These notes describe what the source code does. Reviewed against source at commit c6a7f32 (18 Apr 2024); not an audit.

## What is stored where

| Data         | Location                                   | Form                                                          |
| ------------ | ------------------------------------------ | ------------------------------------------------------------- |
| Your key     | `chrome.storage.local` (`encryptedWallet`) | Encrypted JSON produced by ethers' `wallet.encrypt(password)` |
| Unlocked key | Background worker memory                   | Cleared on lock                                               |

Local storage stays in your browser profile.

## What Encryptor sends to apps

* Public key and state.
* A shared secret for a public key the app supplies.
* Never the private key or recovery phrase through the four external actions.

The popup receives the key object from the background to show the recovery phrase right after creation. That message stays inside the extension.

The code does not make network requests of its own. Apps and the SDK, not the extension, publish your public key.

## Lock behaviour

**Logout** clears the key from memory. After that, Encryptor needs your password.

## Recovery

The recovery phrase recreates the key. The code has no password reset.

## Permissions and why

| Permission  | Used for                                             |
| ----------- | ---------------------------------------------------- |
| `storage`   | Saves the encrypted key                              |
| `scripting` | Posts heartbeat and state events into the active tab |
| `activeTab` | Added in 0.0.6 alongside script injection            |

The manifest does not request host permissions.

Reviewed against source at commit c6a7f32 (18 Apr 2024); not an audit. To report a security concern, see [Security and disclosure](https://wiki.4thtech.io/resources/security.md).
