AppSafe/playground

NPM PACKAGE / HANDS-ON EXAMPLE

See the package work.

A small, public playground for @asafarim/appsafe. Run the same text and byte-level calls you would ship in your own browser app.

Try the playgroundNo server / no upload
Web Crypto APIAES-256-GCMTypeScript
appsafe-demo

import { encryptBytes }

from "@asafarim/appsafe";

 

const payload = await encryptBytes(file, password);

// stays in this browser tab

01 / LIVE PLAYGROUND

Use the public package directly.

This demo has no owner gate because its purpose is to document the reusable npm API. All transforms still happen in browser memory.

Not sent over the network
Encrypted payloadwaiting
Encrypt text to inspect the payload bytes.

The decrypt call uses the in-memory payload or a payload selected from disk. Both paths use the same package function.

02 / COPYABLE RECIPES

Three calls are enough.

Install the package, pass a password you manage, and keep the returned bytes wherever your browser app needs them.

Text round-trip
import { decryptText, encryptText } from "@asafarim/appsafe";

const encrypted = await encryptText("private note", password);
const plaintext = await decryptText(encrypted, password);
File round-trip
import { decryptBytes, encryptBytes } from "@asafarim/appsafe";

const input = new Uint8Array(await file.arrayBuffer());
const encrypted = await encryptBytes(input, password);
const plaintext = await decryptBytes(encrypted, password);
A /

Install

pnpm add @asafarim/appsafe

Works in browser runtimes with Web Crypto support.

B /

Encrypt

await encryptBytes(data, password)

Returns a portable Uint8Array payload with authenticated metadata.

C /

Decrypt

await decryptBytes(payload, password)

Wrong passwords and modified payloads fail closed.