Ir al contenido

Broken Cipher (ARCH6112)

Esta página aún no está disponible en tu idioma.

Key ruby.security.broken-cipher · Severity error · Category security · CWE CWE-327

Ciphers like DES, 3DES, RC4, and Blowfish are cryptographically broken or have inadequate block/key sizes. Use a modern AEAD cipher (AES-GCM) to protect confidential data.

require "openssl"
cipher = OpenSSL::Cipher.new("DES-CBC")
cipher.encrypt
cipher.key = key
encrypted = cipher.update(plaintext) + cipher.final
require "openssl"
cipher = OpenSSL::Cipher.new("aes-256-gcm")
cipher.encrypt
cipher.key = key
iv = cipher.random_iv
encrypted = cipher.update(plaintext) + cipher.final
tag = cipher.auth_tag

Replace legacy ciphers with authenticated AES-256-GCM.