From 22cf3f83a69c6d6c4d5a258a93e0bcf3dc21499f Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Mon, 13 Nov 2023 13:47:17 -0500 Subject: [PATCH] remove randbytes --- titles/idac/echo.py | 1 - titles/sao/index.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/titles/idac/echo.py b/titles/idac/echo.py index 88151a7..08e5526 100644 --- a/titles/idac/echo.py +++ b/titles/idac/echo.py @@ -1,5 +1,4 @@ import logging -from random import randbytes import socket from twisted.internet.protocol import DatagramProtocol diff --git a/titles/sao/index.py b/titles/sao/index.py index 5bbdc7e..be7c3cf 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -6,7 +6,7 @@ from logging.handlers import TimedRotatingFileHandler from os import path from Crypto.Cipher import Blowfish from hashlib import md5 -import random +import secrets from core import CoreConfig, Utils from core.title import BaseServlet @@ -123,7 +123,7 @@ class SaoServlet(BaseServlet): self.logger.debug(f"Response: {resp.hex()}") if self.game_cfg.crypt.enable: - iv = random.randbytes(8) + iv = secrets.token_bytes(8) data_to_crypt = resp[24:] while len(data_to_crypt) % 8 != 0: data_to_crypt += b"\x00"