2024-01-09 09:07:04 +01:00
|
|
|
from starlette.requests import Request
|
|
|
|
from starlette.routing import Route
|
|
|
|
from starlette.responses import Response
|
2024-06-20 03:11:24 +02:00
|
|
|
import logging
|
|
|
|
import coloredlogs
|
2023-02-17 07:02:21 +01:00
|
|
|
from logging.handlers import TimedRotatingFileHandler
|
|
|
|
import zlib
|
|
|
|
import yaml
|
|
|
|
import json
|
|
|
|
import inflection
|
|
|
|
import string
|
|
|
|
from Crypto.Cipher import AES
|
|
|
|
from Crypto.Util.Padding import pad
|
2023-03-17 02:27:03 +01:00
|
|
|
from Crypto.Protocol.KDF import PBKDF2
|
|
|
|
from Crypto.Hash import SHA1
|
2023-03-05 03:58:51 +01:00
|
|
|
from os import path
|
2023-11-09 03:17:48 +01:00
|
|
|
from typing import Tuple, Dict, List
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-03-12 07:00:51 +01:00
|
|
|
from core import CoreConfig, Utils
|
2023-11-09 03:17:48 +01:00
|
|
|
from core.title import BaseServlet
|
|
|
|
from .config import ChuniConfig
|
|
|
|
from .const import ChuniConstants
|
|
|
|
from .base import ChuniBase
|
|
|
|
from .plus import ChuniPlus
|
|
|
|
from .air import ChuniAir
|
|
|
|
from .airplus import ChuniAirPlus
|
|
|
|
from .star import ChuniStar
|
|
|
|
from .starplus import ChuniStarPlus
|
|
|
|
from .amazon import ChuniAmazon
|
|
|
|
from .amazonplus import ChuniAmazonPlus
|
|
|
|
from .crystal import ChuniCrystal
|
|
|
|
from .crystalplus import ChuniCrystalPlus
|
|
|
|
from .paradise import ChuniParadise
|
|
|
|
from .new import ChuniNew
|
|
|
|
from .newplus import ChuniNewPlus
|
|
|
|
from .sun import ChuniSun
|
2023-12-13 07:01:31 +01:00
|
|
|
from .sunplus import ChuniSunPlus
|
2024-06-20 03:11:24 +02:00
|
|
|
from .luminous import ChuniLuminous
|
2023-11-09 03:17:48 +01:00
|
|
|
|
|
|
|
class ChuniServlet(BaseServlet):
|
2023-02-17 07:02:21 +01:00
|
|
|
def __init__(self, core_cfg: CoreConfig, cfg_dir: str) -> None:
|
2023-11-09 03:17:48 +01:00
|
|
|
super().__init__(core_cfg, cfg_dir)
|
2023-02-17 07:02:21 +01:00
|
|
|
self.game_cfg = ChuniConfig()
|
2023-03-17 02:27:03 +01:00
|
|
|
self.hash_table: Dict[Dict[str, str]] = {}
|
2023-03-05 03:58:51 +01:00
|
|
|
if path.exists(f"{cfg_dir}/{ChuniConstants.CONFIG_NAME}"):
|
2023-03-09 17:38:58 +01:00
|
|
|
self.game_cfg.update(
|
|
|
|
yaml.safe_load(open(f"{cfg_dir}/{ChuniConstants.CONFIG_NAME}"))
|
|
|
|
)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
|
|
|
self.versions = [
|
2023-03-17 02:27:03 +01:00
|
|
|
ChuniBase,
|
|
|
|
ChuniPlus,
|
|
|
|
ChuniAir,
|
|
|
|
ChuniAirPlus,
|
|
|
|
ChuniStar,
|
|
|
|
ChuniStarPlus,
|
|
|
|
ChuniAmazon,
|
|
|
|
ChuniAmazonPlus,
|
|
|
|
ChuniCrystal,
|
|
|
|
ChuniCrystalPlus,
|
|
|
|
ChuniParadise,
|
|
|
|
ChuniNew,
|
|
|
|
ChuniNewPlus,
|
2023-05-10 21:32:35 +02:00
|
|
|
ChuniSun,
|
2023-12-13 07:01:31 +01:00
|
|
|
ChuniSunPlus,
|
2024-06-20 03:11:24 +02:00
|
|
|
ChuniLuminous,
|
2023-02-17 07:02:21 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
self.logger = logging.getLogger("chuni")
|
|
|
|
|
|
|
|
if not hasattr(self.logger, "inited"):
|
|
|
|
log_fmt_str = "[%(asctime)s] Chunithm | %(levelname)s | %(message)s"
|
|
|
|
log_fmt = logging.Formatter(log_fmt_str)
|
2023-03-09 17:38:58 +01:00
|
|
|
fileHandler = TimedRotatingFileHandler(
|
|
|
|
"{0}/{1}.log".format(self.core_cfg.server.log_dir, "chuni"),
|
|
|
|
encoding="utf8",
|
|
|
|
when="d",
|
|
|
|
backupCount=10,
|
|
|
|
)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
|
|
|
fileHandler.setFormatter(log_fmt)
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
consoleHandler = logging.StreamHandler()
|
|
|
|
consoleHandler.setFormatter(log_fmt)
|
|
|
|
|
|
|
|
self.logger.addHandler(fileHandler)
|
|
|
|
self.logger.addHandler(consoleHandler)
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
self.logger.setLevel(self.game_cfg.server.loglevel)
|
2023-03-09 17:38:58 +01:00
|
|
|
coloredlogs.install(
|
|
|
|
level=self.game_cfg.server.loglevel, logger=self.logger, fmt=log_fmt_str
|
|
|
|
)
|
2023-02-17 07:02:21 +01:00
|
|
|
self.logger.inited = True
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-03-17 02:56:36 +01:00
|
|
|
for version, keys in self.game_cfg.crypto.keys.items():
|
|
|
|
if len(keys) < 3:
|
|
|
|
continue
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-03-17 02:56:36 +01:00
|
|
|
self.hash_table[version] = {}
|
2023-04-24 03:04:52 +02:00
|
|
|
|
|
|
|
method_list = [
|
|
|
|
method
|
|
|
|
for method in dir(self.versions[version])
|
|
|
|
if not method.startswith("__")
|
|
|
|
]
|
2023-03-17 02:56:36 +01:00
|
|
|
for method in method_list:
|
|
|
|
method_fixed = inflection.camelize(method)[6:-7]
|
2023-12-16 04:22:36 +01:00
|
|
|
# number of iterations was changed to 70 in SUN and then to 36
|
2024-06-20 03:11:24 +02:00
|
|
|
if version == ChuniConstants.VER_CHUNITHM_LUMINOUS:
|
|
|
|
iter_count = 8
|
|
|
|
elif version == ChuniConstants.VER_CHUNITHM_SUN_PLUS:
|
2023-12-16 04:22:36 +01:00
|
|
|
iter_count = 36
|
|
|
|
elif version == ChuniConstants.VER_CHUNITHM_SUN:
|
|
|
|
iter_count = 70
|
|
|
|
else:
|
|
|
|
iter_count = 44
|
|
|
|
|
2023-04-24 03:04:52 +02:00
|
|
|
hash = PBKDF2(
|
|
|
|
method_fixed,
|
|
|
|
bytes.fromhex(keys[2]),
|
|
|
|
128,
|
2023-05-10 23:05:11 +02:00
|
|
|
count=iter_count,
|
2023-04-24 03:04:52 +02:00
|
|
|
hmac_hash_module=SHA1,
|
|
|
|
)
|
|
|
|
|
2023-05-10 23:05:11 +02:00
|
|
|
hashed_name = hash.hex()[:32] # truncate unused bytes like the game does
|
|
|
|
self.hash_table[version][hashed_name] = method_fixed
|
2023-04-24 03:04:52 +02:00
|
|
|
|
|
|
|
self.logger.debug(
|
|
|
|
f"Hashed v{version} method {method_fixed} with {bytes.fromhex(keys[2])} to get {hash.hex()}"
|
|
|
|
)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-03-05 03:58:51 +01:00
|
|
|
@classmethod
|
2023-11-09 03:17:48 +01:00
|
|
|
def is_game_enabled(
|
2023-03-09 17:38:58 +01:00
|
|
|
cls, game_code: str, core_cfg: CoreConfig, cfg_dir: str
|
2023-11-09 03:17:48 +01:00
|
|
|
) -> bool:
|
2023-03-05 03:58:51 +01:00
|
|
|
game_cfg = ChuniConfig()
|
|
|
|
if path.exists(f"{cfg_dir}/{ChuniConstants.CONFIG_NAME}"):
|
2023-03-09 17:38:58 +01:00
|
|
|
game_cfg.update(
|
|
|
|
yaml.safe_load(open(f"{cfg_dir}/{ChuniConstants.CONFIG_NAME}"))
|
|
|
|
)
|
2023-03-05 03:58:51 +01:00
|
|
|
|
|
|
|
if not game_cfg.server.enable:
|
2023-11-09 03:17:48 +01:00
|
|
|
return False
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-11-09 03:17:48 +01:00
|
|
|
return True
|
2023-12-13 07:01:31 +01:00
|
|
|
|
2023-11-09 03:17:48 +01:00
|
|
|
def get_allnet_info(self, game_code: str, game_ver: int, keychip: str) -> Tuple[str, str]:
|
|
|
|
if not self.core_cfg.server.is_using_proxy and Utils.get_title_port(self.core_cfg) != 80:
|
2024-01-09 09:07:04 +01:00
|
|
|
return (f"http://{self.core_cfg.server.hostname}:{Utils.get_title_port(self.core_cfg)}/{game_code}/{game_ver}/", self.core_cfg.server.hostname)
|
|
|
|
|
|
|
|
return (f"http://{self.core_cfg.server.hostname}/{game_code}/{game_ver}/", self.core_cfg.server.hostname)
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2024-01-09 09:07:04 +01:00
|
|
|
def get_routes(self) -> List[Route]:
|
|
|
|
return [
|
|
|
|
Route("/{game:str}/{version:int}/ChuniServlet/{endpoint:str}", self.render_POST, methods=['POST']),
|
|
|
|
Route("/{game:str}/{version:int}/ChuniServlet/MatchingServer/{endpoint:str}", self.render_POST, methods=['POST']),
|
|
|
|
]
|
2023-03-05 03:58:51 +01:00
|
|
|
|
2024-01-09 09:07:04 +01:00
|
|
|
async def render_POST(self, request: Request) -> bytes:
|
|
|
|
endpoint: str = request.path_params.get('endpoint')
|
|
|
|
version: int = request.path_params.get('version')
|
|
|
|
game_code: str = request.path_params.get('game')
|
2023-12-13 07:01:31 +01:00
|
|
|
|
2023-11-09 03:17:48 +01:00
|
|
|
if endpoint.lower() == "ping":
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"returnCode": "1"}'))
|
2023-03-09 16:52:49 +01:00
|
|
|
|
2024-01-09 09:07:04 +01:00
|
|
|
req_raw = await request.body()
|
2023-12-13 07:01:31 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
encrtped = False
|
|
|
|
internal_ver = 0
|
2023-03-12 07:00:51 +01:00
|
|
|
client_ip = Utils.get_ip_addr(request)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-12-13 07:01:31 +01:00
|
|
|
if game_code == "SDHD" or game_code == "SDBT": # JP
|
|
|
|
if version < 105: # 1.0
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM
|
|
|
|
elif version >= 105 and version < 110: # PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_PLUS
|
|
|
|
elif version >= 110 and version < 115: # AIR
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_AIR
|
|
|
|
elif version >= 115 and version < 120: # AIR PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_AIR_PLUS
|
|
|
|
elif version >= 120 and version < 125: # STAR
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_STAR
|
|
|
|
elif version >= 125 and version < 130: # STAR PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_STAR_PLUS
|
|
|
|
elif version >= 130 and version < 135: # AMAZON
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_AMAZON
|
|
|
|
elif version >= 135 and version < 140: # AMAZON PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_AMAZON_PLUS
|
|
|
|
elif version >= 140 and version < 145: # CRYSTAL
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_CRYSTAL
|
|
|
|
elif version >= 145 and version < 150: # CRYSTAL PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_CRYSTAL_PLUS
|
|
|
|
elif version >= 150 and version < 200: # PARADISE
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_PARADISE
|
|
|
|
elif version >= 200 and version < 205: # NEW!!
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_NEW
|
|
|
|
elif version >= 205 and version < 210: # NEW PLUS!!
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS
|
|
|
|
elif version >= 210 and version < 215: # SUN
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_SUN
|
2024-06-20 03:11:24 +02:00
|
|
|
elif version >= 215 and version < 220: # SUN PLUS
|
2023-12-13 07:01:31 +01:00
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_SUN_PLUS
|
2024-06-20 03:11:24 +02:00
|
|
|
elif version >= 220: # LUMINOUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS
|
2023-12-13 07:01:31 +01:00
|
|
|
elif game_code == "SDGS": # Int
|
2024-05-21 06:07:17 +02:00
|
|
|
if version < 110: # SUPERSTAR / SUPERSTAR PLUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_PARADISE # SUPERSTAR / SUPERSTAR PLUS worked fine with it
|
2023-12-13 07:01:31 +01:00
|
|
|
elif version >= 110 and version < 115: # NEW
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_NEW
|
|
|
|
elif version >= 115 and version < 120: # NEW PLUS!!
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS
|
|
|
|
elif version >= 120 and version < 125: # SUN
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_SUN
|
2024-06-20 03:11:24 +02:00
|
|
|
elif version >= 125 and version < 130: # SUN PLUS
|
2023-12-13 07:01:31 +01:00
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_SUN_PLUS
|
2024-06-20 03:11:24 +02:00
|
|
|
elif version >= 130: # LUMINOUS
|
|
|
|
internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS
|
2023-02-17 07:02:21 +01:00
|
|
|
|
|
|
|
if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32:
|
2023-03-09 17:38:58 +01:00
|
|
|
# If we get a 32 character long hex string, it's a hash and we're
|
|
|
|
# doing encrypted. The likelyhood of false positives is low but
|
2023-02-17 07:02:21 +01:00
|
|
|
# technically not 0
|
2023-03-17 02:27:03 +01:00
|
|
|
if internal_ver < ChuniConstants.VER_CHUNITHM_NEW:
|
2024-01-09 09:07:04 +01:00
|
|
|
endpoint = request.headers.get("User-Agent").split("#")[0]
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-03-17 02:27:03 +01:00
|
|
|
else:
|
|
|
|
if internal_ver not in self.hash_table:
|
2023-04-24 03:04:52 +02:00
|
|
|
self.logger.error(
|
|
|
|
f"v{version} does not support encryption or no keys entered"
|
|
|
|
)
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-03-17 02:27:03 +01:00
|
|
|
elif endpoint.lower() not in self.hash_table[internal_ver]:
|
2023-04-24 03:04:52 +02:00
|
|
|
self.logger.error(
|
|
|
|
f"No hash found for v{version} endpoint {endpoint}"
|
|
|
|
)
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-03-17 02:27:03 +01:00
|
|
|
|
|
|
|
endpoint = self.hash_table[internal_ver][endpoint.lower()]
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
try:
|
|
|
|
crypt = AES.new(
|
2023-03-17 02:27:03 +01:00
|
|
|
bytes.fromhex(self.game_cfg.crypto.keys[internal_ver][0]),
|
2023-03-09 17:38:58 +01:00
|
|
|
AES.MODE_CBC,
|
2023-03-17 02:27:03 +01:00
|
|
|
bytes.fromhex(self.game_cfg.crypto.keys[internal_ver][1]),
|
2023-02-17 07:02:21 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
req_raw = crypt.decrypt(req_raw)
|
|
|
|
|
2023-03-17 02:27:03 +01:00
|
|
|
except Exception as e:
|
2023-03-09 17:38:58 +01:00
|
|
|
self.logger.error(
|
2023-03-17 02:27:03 +01:00
|
|
|
f"Failed to decrypt v{version} request to {endpoint} -> {e}"
|
2023-03-09 17:38:58 +01:00
|
|
|
)
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-02-17 07:02:21 +01:00
|
|
|
|
|
|
|
encrtped = True
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-04-24 03:04:52 +02:00
|
|
|
if (
|
|
|
|
not encrtped
|
|
|
|
and self.game_cfg.crypto.encrypted_only
|
|
|
|
and internal_ver >= ChuniConstants.VER_CHUNITHM_CRYSTAL_PLUS
|
|
|
|
):
|
2023-03-09 17:38:58 +01:00
|
|
|
self.logger.error(
|
|
|
|
f"Unencrypted v{version} {endpoint} request, but config is set to encrypted only: {req_raw}"
|
|
|
|
)
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-03-09 17:38:58 +01:00
|
|
|
try:
|
2023-02-17 07:02:21 +01:00
|
|
|
unzip = zlib.decompress(req_raw)
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
except zlib.error as e:
|
2023-03-09 17:38:58 +01:00
|
|
|
self.logger.error(
|
|
|
|
f"Failed to decompress v{version} {endpoint} request -> {e}"
|
|
|
|
)
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
req_data = json.loads(unzip)
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-04-24 03:04:52 +02:00
|
|
|
self.logger.info(f"v{version} {endpoint} request from {client_ip}")
|
2023-03-02 06:24:04 +01:00
|
|
|
self.logger.debug(req_data)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2024-05-21 06:07:17 +02:00
|
|
|
if game_code == "SDGS" and version >= 110:
|
|
|
|
endpoint = endpoint.replace("C3Exp", "")
|
|
|
|
elif game_code == "SDGS" and version < 110:
|
|
|
|
endpoint = endpoint.replace("Exp", "")
|
|
|
|
else:
|
|
|
|
endpoint = endpoint
|
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
func_to_find = "handle_" + inflection.underscore(endpoint) + "_request"
|
2023-03-17 02:27:03 +01:00
|
|
|
handler_cls = self.versions[internal_ver](self.core_cfg, self.game_cfg)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-03-17 02:27:03 +01:00
|
|
|
if not hasattr(handler_cls, func_to_find):
|
2023-03-09 17:29:36 +01:00
|
|
|
self.logger.warning(f"Unhandled v{version} request {endpoint}")
|
|
|
|
resp = {"returnCode": 1}
|
|
|
|
|
2023-03-09 17:38:58 +01:00
|
|
|
else:
|
2023-03-09 17:29:36 +01:00
|
|
|
try:
|
2023-03-17 02:27:03 +01:00
|
|
|
handler = getattr(handler_cls, func_to_find)
|
2024-01-09 09:07:04 +01:00
|
|
|
resp = await handler(req_data)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
2023-03-09 17:29:36 +01:00
|
|
|
except Exception as e:
|
|
|
|
self.logger.error(f"Error handling v{version} method {endpoint} - {e}")
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zlib.compress(b'{"stat": "0"}'))
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2024-06-20 03:11:24 +02:00
|
|
|
if resp is None:
|
2023-03-09 17:38:58 +01:00
|
|
|
resp = {"returnCode": 1}
|
|
|
|
|
2023-03-02 06:24:04 +01:00
|
|
|
self.logger.debug(f"Response {resp}")
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
zipped = zlib.compress(json.dumps(resp, ensure_ascii=False).encode("utf-8"))
|
2023-03-09 17:38:58 +01:00
|
|
|
|
2023-02-17 07:02:21 +01:00
|
|
|
if not encrtped:
|
2024-01-09 09:07:04 +01:00
|
|
|
return Response(zipped)
|
2023-02-17 07:02:21 +01:00
|
|
|
|
|
|
|
padded = pad(zipped, 16)
|
|
|
|
|
|
|
|
crypt = AES.new(
|
2023-03-17 02:42:43 +01:00
|
|
|
bytes.fromhex(self.game_cfg.crypto.keys[internal_ver][0]),
|
2023-03-09 17:38:58 +01:00
|
|
|
AES.MODE_CBC,
|
2023-03-17 02:42:43 +01:00
|
|
|
bytes.fromhex(self.game_cfg.crypto.keys[internal_ver][1]),
|
2023-02-17 07:02:21 +01:00
|
|
|
)
|
|
|
|
|
2024-06-20 03:11:24 +02:00
|
|
|
return Response(crypt.encrypt(padded))
|