search
HomeBackend DevelopmentPHP Tutorial关于php如何解密.net加密后数据库里面的内容和文件

   公司原网站使用的是.net,现在让我用php改版,现在需要将原来的数据库导出来,发现导出来的都是2进制数据,已知他们使用的HttpPostedFile.InputStream将整个文件及内容保存为2进制流存放的,又说是读取的字节(我没听懂),请问我该怎么搞?求指点


回复讨论(解决方案)

什么样的数据?至少应截个图

转化后的东西太长,所以没有截图
这个是我摘的某个数据(论坛字符限制,只发一小部分)
0x424D465C0C0000000000360000002800000058020000C20100000100180000000000105C0C00000000000000000000000000000000004132AB4132AB4132AB4132AB4132AB4132AB4132AB4132AB4132AB4334AD4334AD4132AB3E2FA83D2EA73F30A93E31B13D32C43B31CB3D33CD3E34CE3F34D03E33CF3E33D03D32CF3D32CF3D32CF3D31D13D31D13D30D23D30D23D30D23D31D13F30D13F32CE3F32CA3F33C94031C84031C8412FC84131C54431C34232BB4133B13F32AC4132AC4231B04530B54331BA3F31B83C33B93D33BB3F35BD4134C04134C04033BF4033BF4334BE4234BC4333BC4234B84032B63F31B44132B24030B33D2DB64131BE4434C74337CD4035D23D32D43E33D74034DA4231D84231D84...

0x424D465C0C0......
这样表示的是一个十六进制数的字符串

你可在读取后去掉前面的 0x 后,用 pack 函数还原出原始内容
$s = pack('H*', substr($s, 2));

你示例的是一个 BMP 图片数据

这个我以前试看到过,不过当时用的是C,现在我用H或者C都是同样的乱码问题,始终解决不了,网上资料介绍说是编码问题,我主要的编码都试过了,还是不行,不知道咋办

虽然没有解决问题,还是谢谢你

尽管你只贴出了数据片段,但仍然能看到你的数据时一个 BMP 图片

$s = '424D465C0C0000000000360000002800000058020000C20100000100180000000000105C0C00000000000000000000000000000000004132AB4132AB4132AB4132AB4132AB4132AB4132AB4132AB4132AB4334AD4334AD4132AB3E2FA83D2EA73F30A93E31B13D32C43B31CB3D33CD3E34CE3F34D03E33CF3E33D03D32CF3D32CF3D32CF3D31D13D31D13D30D23D30D23D30D23D31D13F30D13F32CE3F32CA3F33C94031C84031C8412FC84131C54431C34232BB4133B13F32AC4132AC4231B04530B54331BA3F31B83C33B93D33BB3F35BD4134C04134C04033BF4033BF4334BE4234BC4333BC4234B84032B63F31B44132B24030B33D2DB64131BE4434C74337CD4035D23D32D43E33D74034DA4231D84231D84';$s = pack('H*', $s);$FILE = unpack ( "vfile_type/Vfile_size/Vreserved/Vbitmap_offset" , substr($s, 0, 14 ));print_r($FILE);$BMP = unpack ( 'Vheader_size/Vwidth/Vheight/vplanes/vbits_per_pixel' . '/Vcompression/Vsize_bitmap/Vhoriz_resolution' . '/Vvert_resolution/Vcolors_used/Vcolors_important' , substr( $s, 14, 40 )); print_r($BMP);
Array(    [file_type] => 19778    [file_size] => 810054    [reserved] => 0    [bitmap_offset] => 54)Array(    [header_size] => 40    [width] => 600    [height] => 450    [planes] => 1    [bits_per_pixel] => 24    [compression] => 0    [size_bitmap] => 810000    [horiz_resolution] => 0    [vert_resolution] => 0    [colors_used] => 0    [colors_important] => 0)

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.