This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto'); | |
const claveString = 'MiClaveSecreta123'; | |
const ivString = '1234567890123456'; // IV de 16 bytes (128 bits) | |
const textoOriginal = 'Hola, mundo!'; | |
// Generar una clave a partir del string | |
const clave = crypto.createHash('sha256').update(claveString).digest(); | |
// Crear un buffer a partir del IV string |