
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.
encrypt-tools
Advanced tools
A comprehensive TypeScript encryption toolkit providing secure cryptographic operations, signing capabilities, and webhook handling.
A comprehensive TypeScript encryption toolkit providing secure cryptographic operations, signing capabilities, and webhook handling.
npm install encrypt-tools
import { encrypt, decrypt, generateSecretKey } from "encrypt-tools";
// Generate a secure key
const secretKey = generateSecretKey(); // 32 bytes by default
// Encrypt data
const { ciphertext, iv } = encrypt({
plaintext: "sensitive data",
secretKey,
});
// Decrypt data
const decrypted = decrypt({
ciphertext,
secretKey,
iv,
});
console.log(decrypted); // "sensitive data"
import { hash } from "encrypt-tools";
// Default SHA-256
const hashValue = hash("data to hash");
// Specify algorithm
const sha512Hash = hash("data to hash", "sha512");
import { sign, verify, generateSecretKey } from "encrypt-tools";
// Symmetric Signing
const secretKey = generateSecretKey();
const data = JSON.stringify({ userId: "123", action: "login" });
// Sign data
const signature = sign({
data,
secret: secretKey,
algorithm: "sha256",
});
// Verify signature
const isValid = verify({
data,
secret: secretKey,
signature,
algorithm: "sha256",
});
import { sign, verify, generateSecretKey } from "encrypt-tools";
const secretKey = generateSecretKey();
const data = JSON.stringify({ userId: "123", action: "login" });
// Sign data
const signature = sign({
data,
secret: secretKey,
algorithm: "sha256",
});
// Verify signature
const isValid = verify({
data,
secret: secretKey,
signature,
algorithm: "sha256",
});
import { sign, verify, generateRSAKeyPair } from "encrypt-tools";
// Generate key pair
const { privateKey, publicKey } = generateRSAKeyPair();
// Sign data
const signature = sign({
data: "message to sign",
privateKey,
});
// Verify signature
const isValid = verify({
data: "message to sign",
publicKey,
signature,
});
import {
generateWebhookSecret,
signWebhook,
verifyWebhook,
} from "encrypt-tools";
// Generate webhook secret
const secret = generateWebhookSecret(); // Format: whsec_*
// Create event
const event = {
id: "evt_123",
type: "user.created",
timestamp: Date.now(),
data: {
userId: "123",
email: "user@example.com",
},
};
// Sign webhook
const { signature, timestamp } = signWebhook(secret, event);
// Verify webhook
const isValid = verifyWebhook(event, timestamp, signature, secret);
import { generateSecretKey, generateRSAKeyPair, id } from "encrypt-tools";
// Generate symmetric key
const key16 = generateSecretKey(16); // 16 bytes
const key32 = generateSecretKey(); // 32 bytes (default)
// Generate RSA key pair
const { privateKey, publicKey } = generateRSAKeyPair();
// Generate unique ID with prefix
const uniqueId = id("prefix"); // Format: prefix_*
try {
const result = encrypt({
plaintext: "data",
secretKey: "invalid_key",
});
} catch (error) {
if (error instanceof EncryptError) {
console.error(`Error: ${error.message}`);
}
}
FAQs
A comprehensive TypeScript encryption toolkit providing secure cryptographic operations, signing capabilities, and webhook handling.
We found that encrypt-tools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.