当前位置:首页>python>从理论到实践:Python实现网络安全三大加密技术全解析

从理论到实践:Python实现网络安全三大加密技术全解析

  • 2026-04-16 01:55:11
从理论到实践:Python实现网络安全三大加密技术全解析

在网络安全核心技术深化阶段,掌握基础加密技术是构建安全系统的基石。

一、Base64编码/解码实现

1.1 Base64原理

Base64是一种基于64个可打印字符来表示二进制数据的编码方法,主要用于在文本环境中安全传输二进制数据。它将每3个字节(24位)的二进制数据转换为4个Base64字符,每个字符对应6位数据。

1.2 Python实现

方法1:使用标准库base64

import base64defbase64_encode(data):"""Base64编码"""ifisinstance(data, str):        data = data.encode('utf-8')    encoded_data = base64.b64encode(data)return encoded_data.decode('utf-8')defbase64_decode(encoded_data):"""Base64解码"""ifisinstance(encoded_data, str):        encoded_data = encoded_data.encode('utf-8')    decoded_data = base64.b64decode(encoded_data)return decoded_data.decode('utf-8')# 示例使用original_text = "Hello, Base64 Encoding!"encoded = base64_encode(original_text)decoded = base64_decode(encoded)print(f"原始文本: {original_text}")print(f"Base64编码: {encoded}")print(f"Base64解码: {decoded}")

方法2:手动实现Base64编码

import base64import stringdefmanual_base64_encode(data):"""手动实现Base64编码"""ifisinstance(data, str):        data = data.encode('utf-8')# Base64字符集    base64_chars = string.ascii_uppercase + string.ascii_lowercase + string.digits + '+/'    result = []    padding = 0# 处理每3个字节for i inrange(0len(data), 3):        chunk = data[i:i+3]# 计算填充字节数iflen(chunk) < 3:            padding = 3 - len(chunk)            chunk += b'\x00' * padding# 将3字节转换为24位整数        n = int.from_bytes(chunk, 'big')# 分割为4个6位组        six_bits = [            (n >> 18) & 0x3F,            (n >> 12) & 0x3F,            (n >> 6) & 0x3F,            n & 0x3F        ]# 转换为Base64字符for j inrange(4):            result.append(base64_chars[six_bits[j]])# 处理填充if padding > 0:        result[-padding:] = ['='] * paddingreturn''.join(result)# 测试手动实现original_text = "Python Base64"encoded_manual = manual_base64_encode(original_text)encoded_std = base64_encode(original_text)print(f"原始文本: {original_text}")print(f"手动Base64编码: {encoded_manual}")print(f"标准库Base64编码: {encoded_std}")

二、AES对称加密实现

2.1 AES原理

AES(Advanced Encryption Standard)是一种对称加密算法,使用相同的密钥进行加密和解密。它支持128、192和256位密钥长度,分组大小为128位。

2.2 Python实现

使用PyCryptodome库

from Crypto.Cipher import AESfrom Crypto.Util.Padding import pad, unpadfrom Crypto.Random import get_random_bytesimport base64classAESCipher:def__init__(self, key=None):"""初始化AES加密器"""if key isNone:# 生成随机密钥(16, 24或32字节对应AES-128, AES-192, AES-256)self.key = get_random_bytes(32)  # AES-256else:self.key = keydefencrypt(self, plaintext):"""AES加密"""# 生成随机IV(初始化向量)        iv = get_random_bytes(AES.block_size)# 创建加密器        cipher = AES.new(self.key, AES.MODE_CBC, iv)# 填充数据并加密        padded_data = pad(plaintext.encode('utf-8'), AES.block_size)        ciphertext = cipher.encrypt(padded_data)# 返回IV和密文的Base64编码(IV+ciphertext)return base64.b64encode(iv + ciphertext).decode('utf-8')defdecrypt(self, ciphertext_b64):"""AES解密"""# 解码Base64        ciphertext = base64.b64decode(ciphertext_b64)# 提取IV        iv = ciphertext[:AES.block_size]        ciphertext = ciphertext[AES.block_size:]# 创建解密器        cipher = AES.new(self.key, AES.MODE_CBC, iv)# 解密并去除填充        decrypted_data = unpad(cipher.decrypt(ciphertext), AES.block_size)return decrypted_data.decode('utf-8')# 示例使用aes = AESCipher()plaintext = "这是需要加密的敏感数据"# 加密encrypted = aes.encrypt(plaintext)print(f"原始文本: {plaintext}")print(f"AES加密结果: {encrypted}")# 解密decrypted = aes.decrypt(encrypted)print(f"AES解密结果: {decrypted}")# 使用固定密钥示例fixed_key = b'ThisIsASecretKey1234567890123456'# 32字节aes_fixed = AESCipher(fixed_key)encrypted_fixed = aes_fixed.encrypt("固定密钥测试")decrypted_fixed = aes_fixed.decrypt(encrypted_fixed)print(f"\n固定密钥加密: {encrypted_fixed}")print(f"固定密钥解密: {decrypted_fixed}")

AES加密模式选择

AES支持多种加密模式,常见的有:

  • • ECB(电子密码本模式):简单但不安全,相同明文块产生相同密文块
  • • CBC(密码分组链接模式):使用IV,更安全
  • • CFB/OFB:流密码模式
  • • GCM:提供认证加密
# GCM模式示例(提供认证加密)from Crypto.Cipher import AESfrom Crypto.Random import get_random_bytesclassAESGCMCipher:def__init__(self, key=None):if key isNone:self.key = get_random_bytes(32)else:self.key = keydefencrypt(self, plaintext):        cipher = AES.new(self.key, AES.MODE_GCM)        ciphertext, tag = cipher.encrypt_and_digest(plaintext.encode('utf-8'))return {'nonce': cipher.nonce.hex(),'ciphertext': ciphertext.hex(),'tag': tag.hex()        }defdecrypt(self, encrypted_data):        cipher = AES.new(self.key,             AES.MODE_GCM,             nonce=bytes.fromhex(encrypted_data['nonce'])        )        ciphertext = bytes.fromhex(encrypted_data['ciphertext'])        tag = bytes.fromhex(encrypted_data['tag'])try:            decrypted_data = cipher.decrypt_and_verify(ciphertext, tag)return decrypted_data.decode('utf-8')except ValueError as e:print("解密失败,可能数据被篡改:", e)returnNone# GCM模式示例aes_gcm = AESGCMCipher()msg = "使用GCM模式的安全通信"encrypted_gcm = aes_gcm.encrypt(msg)print(f"\nGCM加密结果: {encrypted_gcm}")decrypted_gcm = aes_gcm.decrypt(encrypted_gcm)print(f"GCM解密结果: {decrypted_gcm}")

三、RSA非对称加密实现

3.1 RSA原理

RSA是一种非对称加密算法,使用公钥加密、私钥解密。它基于大数分解的数学难题,安全性依赖于密钥长度。

3.2 Python实现

使用PyCryptodome库

from Crypto.PublicKey import RSAfrom Crypto.Cipher import PKCS1_OAEPimport base64classRSACipher:def__init__(self, key_size=2048):"""初始化RSA密钥对"""self.key_size = key_sizeself.key_pair = RSA.generate(key_size)defget_public_key(self):"""获取公钥(PEM格式)"""returnself.key_pair.publickey().export_key().decode('utf-8')defget_private_key(self):"""获取私钥(PEM格式)"""returnself.key_pair.export_key().decode('utf-8')defencrypt(self, plaintext, public_key=None):"""RSA加密"""if public_key isNone:# 使用自己的公钥加密(实际应用中应使用接收方的公钥)            public_key = self.get_public_key()        recipient_key = RSA.import_key(public_key.encode('utf-8'))        cipher_rsa = PKCS1_OAEP.new(recipient_key)# RSA加密有长度限制,需要分段处理长文本        max_length = self.key_size // 8 - 42# PKCS1_OAEP的填充开销        chunks = []for i inrange(0len(plaintext), max_length):            chunk = plaintext[i:i+max_length]            encrypted_chunk = cipher_rsa.encrypt(chunk.encode('utf-8'))            chunks.append(base64.b64encode(encrypted_chunk).decode('utf-8'))return''.join(chunks)defdecrypt(self, ciphertext, private_key=None):"""RSA解密"""if private_key isNone:            private_key = self.get_private_key()        self_key = RSA.import_key(private_key.encode('utf-8'))        cipher_rsa = PKCS1_OAEP.new(self_key)# 处理分段加密的数据        max_length = self.key_size // 8# 解密后的最大长度        decrypted_chunks = []# 这里简化处理,实际应用中需要知道如何分割密文块# 假设ciphertext是单个块的Base64编码try:            encrypted_chunk = base64.b64decode(ciphertext)            decrypted_chunk = cipher_rsa.decrypt(encrypted_chunk)            decrypted_chunks.append(decrypted_chunk.decode('utf-8'))except:# 更健壮的实现需要处理分段print("解密错误,可能是多块加密数据")returnNonereturn''.join(decrypted_chunks)# 示例使用rsa = RSACipher()# 获取密钥public_key = rsa.get_public_key()private_key = rsa.get_private_key()print("\nRSA公钥:")print(public_key)print("\nRSA私钥:")print(private_key)# 加密解密测试message = "这是使用RSA加密的秘密消息"print(f"\n原始消息: {message}")# 加密(实际应用中应使用接收方的公钥)encrypted_rsa = rsa.encrypt(message)print(f"RSA加密结果: {encrypted_rsa[:100]}...")  # 只显示前100字符# 解密(使用自己的私钥)decrypted_rsa = rsa.decrypt(encrypted_rsa)print(f"RSA解密结果: {decrypted_rsa}")

更完整的RSA加密解密实现(处理长文本)

from Crypto.PublicKey import RSAfrom Crypto.Cipher import PKCS1_OAEPimport base64classAdvancedRSACipher:def__init__(self, key_size=2048):self.key_size = key_sizeself.key_pair = RSA.generate(key_size)defencrypt_long_text(self, plaintext, public_key=None):"""加密长文本"""if public_key isNone:            public_key = self.get_public_key()        recipient_key = RSA.import_key(public_key.encode('utf-8'))        cipher_rsa = PKCS1_OAEP.new(recipient_key)# 生成随机对称密钥from Crypto.Cipher import AESfrom Crypto.Random import get_random_bytes        session_key = get_random_bytes(32)  # AES-256密钥# 用AES加密数据        iv = get_random_bytes(AES.block_size)        cipher_aes = AES.new(session_key, AES.MODE_CBC, iv)        padded_data = pad(plaintext.encode('utf-8'), AES.block_size)        ciphertext_aes = cipher_aes.encrypt(padded_data)# 用RSA加密会话密钥        encrypted_session_key = cipher_rsa.encrypt(session_key)# 组合结果: RSA加密的会话密钥 + IV + AES加密的数据        result = {'encrypted_key': base64.b64encode(encrypted_session_key).decode('utf-8'),'iv': base64.b64encode(iv).decode('utf-8'),'ciphertext': base64.b64encode(ciphertext_aes).decode('utf-8')        }return resultdefdecrypt_long_text(self, encrypted_data, private_key=None):"""解密长文本"""if private_key isNone:            private_key = self.get_private_key()        self_key = RSA.import_key(private_key.encode('utf-8'))        cipher_rsa = PKCS1_OAEP.new(self_key)# 解码各部分        encrypted_session_key = base64.b64decode(encrypted_data['encrypted_key'])        iv = base64.b64decode(encrypted_data['iv'])        ciphertext_aes = base64.b64decode(encrypted_data['ciphertext'])# 解密会话密钥        session_key = cipher_rsa.decrypt(encrypted_session_key)# 用AES解密数据from Crypto.Cipher import AESfrom Crypto.Util.Padding import unpad        cipher_aes = AES.new(session_key, AES.MODE_CBC, iv)        decrypted_data = unpad(cipher_aes.decrypt(ciphertext_aes), AES.block_size)return decrypted_data.decode('utf-8')defget_public_key(self):returnself.key_pair.publickey().export_key().decode('utf-8')defget_private_key(self):returnself.key_pair.export_key().decode('utf-8')# 混合加密示例advanced_rsa = AdvancedRSACipher()long_message = """这是需要加密的长文本。在实际应用中,RSA直接加密长文本效率低下且有限制,因此通常采用混合加密方案:使用RSA加密对称密钥,然后用对称密钥加密实际数据。这种方法结合了非对称加密的安全性和对称加密的效率。"""print(f"\n原始长消息({len(long_message)}字符):")print(long_message[:100] + "...")  # 只显示前100字符# 加密encrypted_hybrid = advanced_rsa.encrypt_long_text(long_message)print("\n混合加密结果结构:")print(f"加密的会话密钥长度: {len(encrypted_hybrid['encrypted_key'])}")print(f"IV长度: {len(encrypted_hybrid['iv'])}")print(f"密文长度: {len(encrypted_hybrid['ciphertext'])}")# 解密decrypted_hybrid = advanced_rsa.decrypt_long_text(encrypted_hybrid)print(f"\n解密后的消息({len(decrypted_hybrid)}字符):")print(decrypted_hybrid[:100] + "...")  # 只显示前100字符

四、综合应用示例:安全文件传输模拟

import jsonimport osfrom Crypto.Cipher import AESfrom Crypto.Random import get_random_bytesfrom Crypto.PublicKey import RSAfrom Crypto.Cipher import PKCS1_OAEPimport base64classSecureFileTransfer:def__init__(self):# 生成RSA密钥对用于密钥交换self.rsa_key = RSA.generate(2048)self.public_key = self.rsa_key.publickey().export_key().decode('utf-8')self.private_key = self.rsa_key.export_key().decode('utf-8')# 存储会话密钥(实际应用中不应长期存储)self.session_key = Nonedefgenerate_session_key(self):"""生成随机会话密钥"""return get_random_bytes(32)  # AES-256defencrypt_file(self, file_path, recipient_public_key):"""加密文件(混合加密方案)"""try:withopen(file_path, 'rb'as f:                file_data = f.read()# 生成会话密钥            session_key = self.generate_session_key()# 用AES加密文件数据            iv = get_random_bytes(AES.block_size)            cipher_aes = AES.new(session_key, AES.MODE_CBC, iv)            padded_data = pad(file_data, AES.block_size)            ciphertext_aes = cipher_aes.encrypt(padded_data)# 用接收方的RSA公钥加密会话密钥            recipient_rsa = RSA.import_key(recipient_public_key.encode('utf-8'))            cipher_rsa = PKCS1_OAEP.new(recipient_rsa)            encrypted_session_key = cipher_rsa.encrypt(session_key)# 准备传输的数据结构            transfer_data = {'encrypted_key': base64.b64encode(encrypted_session_key).decode('utf-8'),'iv': base64.b64encode(iv).decode('utf-8'),'ciphertext': base64.b64encode(ciphertext_aes).decode('utf-8')            }# 保存加密后的文件(实际应用中可能直接传输)            encrypted_file_path = file_path + '.encrypted'withopen(encrypted_file_path, 'w'as f:                json.dump(transfer_data, f)print(f"文件加密成功,保存为: {encrypted_file_path}")return encrypted_file_pathexcept Exception as e:print(f"文件加密失败: {e}")returnNonedefdecrypt_file(self, encrypted_file_path, output_path=None):"""解密文件"""try:withopen(encrypted_file_path, 'r'as f:                transfer_data = json.load(f)# 解码各部分            encrypted_session_key = base64.b64decode(transfer_data['encrypted_key'])            iv = base64.b64decode(transfer_data['iv'])            ciphertext_aes = base64.b64decode(transfer_data['ciphertext'])# 用自己的RSA私钥解密会话密钥            self_rsa = RSA.import_key(self.private_key.encode('utf-8'))            cipher_rsa = PKCS1_OAEP.new(self_rsa)            session_key = cipher_rsa.decrypt(encrypted_session_key)# 用AES解密文件数据            cipher_aes = AES.new(session_key, AES.MODE_CBC, iv)            decrypted_data = unpad(cipher_aes.decrypt(ciphertext_aes), AES.block_size)# 确定输出路径if output_path isNone:if encrypted_file_path.endswith('.encrypted'):                    output_path = encrypted_file_path[:-9]else:                    output_path = os.path.splitext(encrypted_file_path)[0] + '.decrypted'# 保存解密后的文件withopen(output_path, 'wb'as f:                f.write(decrypted_data)print(f"文件解密成功,保存为: {output_path}")return output_pathexcept Exception as e:print(f"文件解密失败: {e}")returnNone# 模拟安全文件传输if __name__ == "__main__":# 创建发送方和接收方(实际应用中是不同的实体)    sender = SecureFileTransfer()    receiver = SecureFileTransfer()  # 模拟接收方有自己的密钥对# 创建测试文件    test_file = "secure_data.txt"withopen(test_file, 'w'as f:        f.write("这是需要安全传输的敏感文件内容。\n包含多行文本数据。")print(f"创建测试文件: {test_file}")# 发送方加密文件(使用接收方的公钥)# 在实际应用中,接收方会将自己的公钥安全地发送给发送方    encrypted_file = sender.encrypt_file(test_file, receiver.public_key)if encrypted_file:# 接收方解密文件(使用自己的私钥)        decrypted_file = receiver.decrypt_file(encrypted_file)# 验证解密后的文件内容withopen(decrypted_file, 'r'as f:            decrypted_content = f.read()print("\n验证解密内容:")print(decrypted_content)# 清理测试文件        os.remove(test_file)        os.remove(encrypted_file)        os.remove(decrypted_file)

五、安全注意事项

  1. 1. 密钥管理
    • • 私钥必须严格保密
    • • 考虑使用硬件安全模块(HSM)或密钥管理系统
    • • 定期轮换密钥
  2. 2. 加密模式选择
    • • AES优先选择GCM或CBC模式
    • • 避免使用ECB模式
    • • 确保使用随机且唯一的IV
  3. 3. 填充方案
  4. 4. 性能考虑
    • • RSA适合加密小数据量(如对称密钥)
    • • 大文件加密应使用混合加密方案
  5. 5. 实现验证
    • • 使用已知答案测试(KAT)验证实现正确性
    • • 考虑使用FIPS 140-2验证的加密库

本文通过完整的Python实现,深入探讨了Base64编码、AES对称加密和RSA非对称加密的核心技术:

  1. 1. Base64:简单但强大的二进制到文本编码方法,广泛用于数据传输
  2. 2. AES:现代对称加密的标准,提供高效的数据加密
  3. 3. RSA:非对称加密的基石,用于安全密钥交换和数字签名
  4. 4. 混合加密:结合非对称和对称加密的优势,实现安全高效的数据传输

这些技术是构建安全系统的基础,理解它们的原理和实现对于网络安全攻防至关重要。在实际应用中,应考虑使用经过充分验证的加密库(如PyCryptodome、cryptography等),并遵循最佳安全实践。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-16 01:59:07 HTTP/2.0 GET : https://f.mffb.com.cn/a/485953.html
  2. 运行时间 : 0.103555s [ 吞吐率:9.66req/s ] 内存消耗:4,683.84kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=954dc247a03eea134a7233564280fd6a
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000614s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000793s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000330s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000261s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000486s ]
  6. SELECT * FROM `set` [ RunTime:0.000211s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000515s ]
  8. SELECT * FROM `article` WHERE `id` = 485953 LIMIT 1 [ RunTime:0.000927s ]
  9. UPDATE `article` SET `lasttime` = 1776275947 WHERE `id` = 485953 [ RunTime:0.014776s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000259s ]
  11. SELECT * FROM `article` WHERE `id` < 485953 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000573s ]
  12. SELECT * FROM `article` WHERE `id` > 485953 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000430s ]
  13. SELECT * FROM `article` WHERE `id` < 485953 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.005150s ]
  14. SELECT * FROM `article` WHERE `id` < 485953 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001349s ]
  15. SELECT * FROM `article` WHERE `id` < 485953 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003590s ]
0.106191s