ERP-node/backend-node/scripts/encrypt-password.ts

17 lines
601 B
TypeScript
Raw Permalink Normal View History

2025-10-20 17:50:27 +09:00
/**
*
*/
import { CredentialEncryption } from "../src/utils/credentialEncryption";
const encryptionKey =
process.env.ENCRYPTION_SECRET_KEY || "default-secret-key-for-development";
const encryption = new CredentialEncryption(encryptionKey);
const password = process.argv[2] || "ph0909!!";
const encrypted = encryption.encrypt(password);
console.log("\n원본 비밀번호:", password);
console.log("암호화된 비밀번호:", encrypted);
console.log("\n복호화 테스트:", encryption.decrypt(encrypted));
console.log("✅ 암호화/복호화 성공\n");