
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
prisma-encrypter
Advanced tools
This package allows you to encrypt your models in Prisma
Install the package using npm
npm install prisma-encrypter
If you use ivField on a model, don't forget to include this field in your select/update queries. key argument must be a 32-bits key iv argument must be a 16-bits key
This supports include models, included fields has to include the name of the field, for example accounts -> Account. TODO: analyze prisma.schema to make a correspondance table.
model Item {
id Int @default(autoincrement()) @id
accountId Int?
accounts Account? @relation(fields: [accountId], references: [id])
}
import { PrismaClient } from '@prisma/client';
import { encryptionMiddleware } from 'prisma-encrypter';
const prisma = new PrismaClient();
prisma.$use(
encryptionMiddleware({
global: {
key: 'Xp2r5u8x/A?DcG+KbPeShVmYq3t6v9y$',
},
models: [
{
model: 'User',
fields: ['password'],
},
],
})
);
import { PrismaClient } from '@prisma/client';
import { encryptionMiddleware, encryptModels } from 'prisma-encrypter';
const prisma = new PrismaClient();
prisma.$use(
encryptionMiddleware({
global: {
iv: 'C*F-J@NcRfUjXn2r',
algorithm: 'aes-256-cbc',
},
models: [
{
model: 'User',
fields: ['password', 'secret'],
local: {
key: '2p2r5u8x/A?DcG+KbPeShVmYq3t6v9y1',
ivField: 'hash',
stripIvField: true,
},
},
],
})
);
// In another file, you can add more models (or one using encryptModel).
encryptModels([
{
model: 'Vault',
local: {
key: 'NcRfUjXn2r5u8x!A%D*G-KaPdSgVkYp3',
iv: 'Zq4t7w!z%C*F-J@N',
algorithm: 'aes-256-gcm',
},
},
{
model: 'Entries',
fields: ['code'],
local: {
key: 'w9z$C&F)J@NcRfUjXn2r5u7x!A%D*G-K',
},
},
]);
//
The lib also exposes manualEncrypt() and manualDecrypt()
FAQs
Lightweight encryption solution for Prisma
The npm package prisma-encrypter receives a total of 5 weekly downloads. As such, prisma-encrypter popularity was classified as not popular.
We found that prisma-encrypter demonstrated a healthy version release cadence and project activity because the last version was released less than 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.