백엔드 전체 구현 완료: 내부 서비스(Auth, Client, Realtime), API 엔드포인트 및 스케줄러 구현

This commit is contained in:
2026-02-02 23:55:07 +09:00
parent 03027d2206
commit 4f0cc05f39
22 changed files with 1279 additions and 23 deletions

View File

@@ -0,0 +1,19 @@
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad
from base64 import b64decode
def aes_cbc_base64_dec(key: str, iv: str, cipher_text: str) -> str:
"""
Decrypts KIS WebSocket data using AES-256-CBC.
adapted from KIS official sample.
"""
if not key or not iv:
raise ValueError("Key and IV are required for decryption")
# Key and IV are assumed to be utf-8 strings
cipher = AES.new(key.encode("utf-8"), AES.MODE_CBC, iv.encode("utf-8"))
# Decrypt and unpad
decrypted_bytes = unpad(cipher.decrypt(b64decode(cipher_text)), AES.block_size)
return bytes.decode(decrypted_bytes, 'utf-8')