Skip to content

Instantly share code, notes, and snippets.

View heomeco2014's full-sized avatar
💭
Keep learning

nminhdev heomeco2014

💭
Keep learning
View GitHub Profile
const crypto = require('crypto');
const fs = require('fs');
// Phát sinh một khoá bí mật Ks của thuật toán AES
function generateAESSecretKey() {
return crypto.randomBytes(32); // 32 bytes = 256 bits
}
// Mã hoá tập tin sử dụng thuật toán AES với khoá Ks
function encryptFileAES(filePath, secretKey) {