mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-05-12 17:53:53 +00:00
perf: 修改rsa key 默认长度
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
from collections import defaultdict
|
||||
from hashlib import md5
|
||||
from socket import gethostname
|
||||
|
||||
import yaml
|
||||
@@ -146,7 +146,7 @@ class BasePlaybookManager:
|
||||
|
||||
@staticmethod
|
||||
def generate_private_key_path(secret, path_dir):
|
||||
key_name = '.' + md5(secret.encode('utf-8')).hexdigest()
|
||||
key_name = '.' + hashlib.md5(secret.encode('utf-8')).hexdigest()
|
||||
key_path = os.path.join(path_dir, key_name)
|
||||
|
||||
if not os.path.exists(key_path):
|
||||
|
||||
@@ -2,15 +2,14 @@ import base64
|
||||
import logging
|
||||
import re
|
||||
|
||||
from Cryptodome.Cipher import AES, PKCS1_v1_5
|
||||
from Cryptodome.Random import get_random_bytes
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Util.Padding import pad
|
||||
from Cryptodome import Random
|
||||
from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
|
||||
|
||||
from Cryptodome.Cipher import AES, PKCS1_v1_5
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Random import get_random_bytes
|
||||
from Cryptodome.Util.Padding import pad
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
|
||||
|
||||
from common.sdk.gm import piico
|
||||
|
||||
@@ -248,7 +247,7 @@ class Crypto:
|
||||
continue
|
||||
|
||||
|
||||
def gen_key_pair(length=1024):
|
||||
def gen_key_pair(length=2048):
|
||||
""" 生成加密key
|
||||
用于登录页面提交用户名/密码时,对密码进行加密(前端)/解密(后端)
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user