open-index/open-npm huggingface dataset:
npm package: @guardify/browser
Description: Guardify Browser Package – Secure API encryption and compression for frontend applications.
Latest version: 1.0.2

# @guardify/browser

Guardify Browser Package – Secure API encryption and compression for frontend applications.

## Installation

```bash
npm install @guardify/browser
```

## Usage

```javascript
import { encryptAndCompressRSA } from "@guardify/browser";

const payload = { name: "jaydip", age: 20 };
const encryptedCompressed = await encryptAndCompressRSA(
  payload,
  `-----BEGIN PUBLIC KEY-----
...your public key here...
-----END PUBLIC KEY-----`
);
await fetch("http://localhost:3000/submit", {
  method: "POST",
  headers: { "Content-Type": "application/octet-stream" },
  body: encryptedCompressed,
});
```

## Features

- Easy encryption & compression

- Works in the browser

- TypeScript ready

- Works with Node.js backend decryption

## License

[LICENSE](../../LICENSE)
npm package: @guardify/server
Description: Guardify Server Package – Secure API decryption and backend utilities for API security.
Latest version: 1.0.2

# @guardify/server

Guardify Server Package – Secure API decryption and backend utilities for API security.

## Installation

```bash
npm install @guardify/server
```

## Usage

```javascript
import express from "express";
import cors from "cors";
import { decryptMiddlewareRSA } from "@guardify/server";

const app = express();
const PRIVATE_KEY = `-----BEGIN PRIVATE KEY-----
...your private key here...
-----END PRIVATE KEY-----
`;

app.use(cors({ origin: "http://localhost:5173" }));

app.post(
  "/submit",
  express.raw({ type: "application/octet-stream" }),
  decryptMiddlewareRSA(PRIVATE_KEY),
  (req, res) => {
    console.log("Decrypted payload:", req.body);

    const isValid = req.body?.name === "jaydip" && Number(req.body?.age) === 20;

    res.json({
      message: "Data received successfully",
      received: req.body,
      valid: isValid,
    });
  }
);

app.listen(3000, () => console.log("Server running on http://localhost:3000"));
```

## Features

- Decrypt data sent from the browser
- Middleware ready for Express.js
- TypeScript support
- Works with `@guardify/browser` for full-stack encryption

## License

[LICENSE](../../LICENSE)