
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A TypeScript SDK for Proxy Re-Encryption (PRE) and cryptographic primitives, enabling secure data sharing directly in the browser.
This SDK allows users to securely encrypt and share data via a proxy service, without exposing raw data to the proxy. It includes full client-side support for key generation, encryption, and Proxy Re-Encryption (PRE).
This SDK implements the PRE method as detailed in our design spec: Overleaf PRE Design Doc (Work in progress)
npm install pre-ts
# or
yarn add pre-ts
import { PreSdk, SecretKey } from "pre-ts";
const client = new PreSdk();
const shares = await client.generateShares();
const data = new Uint8Array([
/* your data */
]);
const secretKey = SecretKey.fromBytes(await client.pre.combineSecret(shares));
const encrypted = await client.encryptData(secretKey, data);
const client = new PreSdk();
const shares = await client.generateShares();
const passphrase = "your-secure-passphrase";
const encryptedShare = await encryptShare(shares[0], passphrase);
localStorage.setItem(
"share1",
JSON.stringify({
share: Array.from(new Uint8Array(encryptedShare)),
hasPassphrase: true,
passphraseHash: hashPassphrase(passphrase),
})
);
const secretBytes = await client.pre.combineSecret([share1Array, share2Array]);
const secret = SecretKey.fromBytes(secretBytes);
const encrypted = await client.encryptData(secret, new Uint8Array(dataBuffer));
const reKey = client.preClient.generateReEncryptionKey(
senderSecret.first,
recipientPublic.second
);
const proxyClient = new pre.ProxyClient();
await proxyClient.store(
reKey,
encrypted.encryptedKey,
encrypted.encryptedMessage,
"userId"
);
const { firstLevelKey, encryptedData } = await proxyClient.request(
proxyStoreId
);
const decrypted = await client.preClient.decryptFirstLevel(
{
encryptedKey: firstLevelKey,
encryptedMessage: encryptedData,
},
recipientSecretKey
);
PreSdkgenerateShares(): Promise<Uint8Array[]>encryptData(secret: SecretKey, data: Uint8Array): Promise<SecondLevelEncryptionResponse>pre: Contains utility methods like combineSecret()ProxyClientHandles proxy server communication.
store(reEncryptionKey: G2Point, encryptedKey: Uint8Array, encryptedMessage: Uint8Array, userId: string): Promise<ProxyResponse>request(id: string): Promise<{ firstLevelKey: Uint8Array, encryptedData: Uint8Array }>MIT License — see LICENSE for details.
PRs and issues welcome! See CONTRIBUTING.md for more info.
FAQs
TypeScript implementation of Proxy Re-Encryption (PRE)
We found that pre-ts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.