remove randbytes

This commit is contained in:
Hay1tsme 2023-11-13 13:47:17 -05:00
parent ee45c55f66
commit 22cf3f83a6
2 changed files with 2 additions and 3 deletions

View File

@ -1,5 +1,4 @@
import logging
from random import randbytes
import socket
from twisted.internet.protocol import DatagramProtocol

View File

@ -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"