forked from Hay1tsme/artemis
remove randbytes
This commit is contained in:
parent
ee45c55f66
commit
22cf3f83a6
@ -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
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user