1
0
forked from Hay1tsme/artemis

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 import logging
from random import randbytes
import socket import socket
from twisted.internet.protocol import DatagramProtocol from twisted.internet.protocol import DatagramProtocol

View File

@ -6,7 +6,7 @@ from logging.handlers import TimedRotatingFileHandler
from os import path from os import path
from Crypto.Cipher import Blowfish from Crypto.Cipher import Blowfish
from hashlib import md5 from hashlib import md5
import random import secrets
from core import CoreConfig, Utils from core import CoreConfig, Utils
from core.title import BaseServlet from core.title import BaseServlet
@ -123,7 +123,7 @@ class SaoServlet(BaseServlet):
self.logger.debug(f"Response: {resp.hex()}") self.logger.debug(f"Response: {resp.hex()}")
if self.game_cfg.crypt.enable: if self.game_cfg.crypt.enable:
iv = random.randbytes(8) iv = secrets.token_bytes(8)
data_to_crypt = resp[24:] data_to_crypt = resp[24:]
while len(data_to_crypt) % 8 != 0: while len(data_to_crypt) % 8 != 0:
data_to_crypt += b"\x00" data_to_crypt += b"\x00"