19 lines
591 B
TypeScript
Executable File
19 lines
591 B
TypeScript
Executable File
import { NextResponse } from 'next/server';
|
|
import { encrypt, decrypt } from '@/lib/crypto';
|
|
|
|
export async function GET() {
|
|
const originalData = "1500000"; // 테스트할 자산 금액
|
|
|
|
// 1. 암호화 수행
|
|
const encrypted = encrypt(originalData);
|
|
|
|
// 2. 복호화 수행 (검증용)
|
|
const decrypted = decrypt(encrypted);
|
|
|
|
return NextResponse.json({
|
|
original: originalData,
|
|
encrypted: encrypted, // DB에 들어갈 형태: "iv:authTag:ciphertext"
|
|
decrypted: decrypted,
|
|
isMatch: originalData === decrypted
|
|
});
|
|
} |