This file contains hidden or 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 { writeFileSync } = require('fs') | |
| const { join } = require('path') | |
| const BUILD_DATE_TIME_STAMP_PATH = join(__dirname, 'build-date.json'); | |
| const createBuildDate = { | |
| buildDate: new Date() | |
| } | |
| writeFileSync(TIME_STAMP_PATH, JSON.stringify(createBuildDate, null, 2)); |
This file contains hidden or 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 aes = require("aes-js"); | |
| const argon2 = require("argon2"); | |
| const crypto = require("crypto"); | |
| const cryptoJS = require("crypto-js"); | |
| // Encrypt using AES-256-CTR-Argon2-HMAC-SHA-256 | |
| async function aes256ctrEncrypt(plaintext, password) { | |
| let argon2salt = crypto.randomBytes(16); // 128-bit salt for argon2 | |
| let argon2Settings = { type: argon2.argon2di, raw: true, | |
| timeCost: 8, memoryCost: 2 ** 15, parallelism: 2, |