
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@voiceflow/encryption
Advanced tools
Voiceflow encryption library
yarn add @voiceflow/encryption
import crypto from 'crypto';
import { encryptAes256Gcm, decryptAes256Gcm } from '@voiceflow/encryption';
// create a key
const createAES256Key = () =>
new Promise<string>((resolve) => {
crypto.generateKey('aes', { length: 256 }, (err, key) => {
if (err) throw err;
resolve(key.export().toString('base64'));
});
});
const encryptionKey = await createAES256Key();
// Encrypt data
const plaintext = 'sensitive data';
const encrypted = encryptAes256Gcm(plaintext, encryptionKey);
// Decrypt data
const decrypted = decryptAes256Gcm(encrypted, encryptionKey);
console.log(decrypted); // 'sensitive data'
import { Module } from '@nestjs/common';
import { EncryptionModule } from '@voiceflow/encryption';
@Module({
imports: [
EncryptionModule.register({
encryptionKey: 'your-base64-encoded-key',
}),
],
})
export class AppModule {}
Or with async configuration:
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { EncryptionModule } from '@voiceflow/encryption';
@Module({
imports: [
ConfigModule.forRoot(),
EncryptionModule.registerAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
encryptionKey: configService.get('ENCRYPTION_KEY'),
}),
}),
],
})
export class AppModule {}
Then inject and use the service:
import { Injectable } from '@nestjs/common';
import { EncryptionService } from '@voiceflow/encryption';
@Injectable()
export class YourService {
constructor(private readonly encryptionService: EncryptionService) {}
encryptSensitiveData(data: string) {
return this.encryptionService.encrypt(data);
}
decryptSensitiveData(encryptedData) {
return this.encryptionService.decrypt(encryptedData);
}
}
FAQs
Voiceflow encryption library
We found that @voiceflow/encryption demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 23 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.