const crypto = require('crypto'); function generateSignature(date, tokenSecret) { const key = crypto.createHash('sha256').update(tokenSecret).digest('hex').slice(0, 32); const fullHash = crypto.createHash('sha256').update(tokenSecret).digest('hex'); const iv = crypto.createHash('sha256').update(fullHash).digest('hex').slice(0, 16); const cipher = crypto.createCipheriv('aes-256-cbc', key, iv); let encrypted = cipher.update(date, 'utf8', 'base64'); encrypted += cipher.final('base64'); return encrypted; } const date = "2026-05-20 14:30:00"; const tokenSecret = "votre-token-secret"; const signature = generateSignature(date, tokenSecret); console.log(signature);