17 lines
601 B
TypeScript
17 lines
601 B
TypeScript
|
|
/**
|
||
|
|
* 비밀번호 암호화 유틸리티
|
||
|
|
*/
|
||
|
|
|
||
|
|
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");
|