İçeriğe geç

Kırık şifreleme algoritması (ARCH3112)

Anahtar typescript.security.broken-cipher · Önem error · Kategori security · CWE CWE-327

DES, 3DES, RC4 ve Blowfish gibi eski simetrik şifreler kriptografik olarak kırılmıştır ve gizliliği sağlamaz. Hassas verileri korumak için modern, kimlik doğrulamalı bir şifre kullanın.

import { createCipheriv } from "crypto";
const cipher = createCipheriv("des-ede3-cbc", key, iv);
const encrypted = cipher.update(secret, "utf8", "hex") + cipher.final("hex");
import { createCipheriv } from "crypto";
const cipher = createCipheriv("aes-256-gcm", key, iv);
const encrypted = Buffer.concat([cipher.update(secret, "utf8"), cipher.final()]);
const tag = cipher.getAuthTag();

DES/3DES/RC4/Blowfish yerine AES-256-GCM gibi kimlik doğrulamalı modern bir şifre kullanın.