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
'use strict'; | |
const crypto = require('crypto'); | |
const KEY_LENGTH = 32; // Must be 32 bytes | |
const IV_LENGTH = 16; // For AES, this is always 16 | |
// Creates 32 byte key (for AES-256), buffer | |
const createKey = () => crypto.randomBytes(KEY_LENGTH); |