PHP 소스 코드 php-beast 암호화

不言
풀어 주다: 2023-04-02 14:52:02
원래의
5059명이 탐색했습니다.

이 기사에서는 특정 참조 값을 갖는 PHP 소스 코드 php-beast의 암호화를 주로 소개합니다. 이제는 모든 사람들과 공유합니다.

php-beast 설치 #🎜 🎜#

php-beast 소스코드 다운로드 주소:

https://github.com/liexusong/php-beast

압축을 풀고 소스를 입력하세요 코드 디렉토리#🎜 🎜#
[innpay@localhost soft]$ unzip php-beast-master.zip 

[innpay@localhost soft]$ cd php-beast-master
[innpay@localhost php-beast-master]$ pwd/home/pony/soft/php-beast-master
로그인 후 복사

컴파일 및 설치

[innpay@localhost php-beast-master]$ /home/pony/php/bin/phpize 
Configuring for:
PHP Api Version:         20131106Zend Module Api No:      20131226Zend Extension Api No:   220131226[innpay@localhost php-beast-master]$ ./configure --with-php-config=/home/pony/php/bin/php-config


[innpay@localhost php-beast-master]$ make

[innpay@localhost php-beast-master]$ make install
Installing shared extensions:     /home/pony/php/lib/php/extensions/no-debug-non-zts-20131226/
로그인 후 복사

설치가 완료된 후 no-debug-non-zts-20131226 디렉토리에 beast.so를 생성합니다.

php.ini를 편집하고 구성 항목 추가: Extension=beast.so

아파치를 다시 시작하고 phpinfo를 통해 beast가 적용되는지 확인

[innpay@localhost apache2]$ ./bin/apachectl restart
로그인 후 복사

# 🎜 🎜#

php-beast 사용PHP 소스 코드 php-beast 암호화

설치가 완료된 후 소스코드 디렉토리 아래 tools 디렉토리에 들어가서configure.ini

[innpay@localhost tools]$ cat configure.ini 
; source path
src_path = "/home/pony/php/apache2/htdocs/wechat_nofity"; destination path
dst_path = "/home/pony/php/apache2/htdocs/des"; expire time
expire = "2019-01-01 12:00:00"; encrypt typeencrypt_type = "DES"
로그인 후 복사
#🎜 🎜##🎜🎜 #src_path는 암호화할 프로젝트의 경로, dst_path는 암호화된 프로젝트를 저장할 경로, 만료는 프로젝트를 설정할 수 있는 시간(만료 형식은 YYYY-mm-dd HH) :ii:ss). encrypt_type은 암호화 방법이며 옵션은 DES, AES, BASE64입니다. configure.ini 파일을 수정한 후 php encode_files.php 명령을 사용하여 암호화 프로젝트를 시작할 수 있습니다.

여기에서 php 명령을 인식할 수 없는 문제가 발생할 수 있습니다:
php: command not found
로그인 후 복사

해결책은 php의 실행 경로를 PATH에 추가하는 것입니다. .bash_profile 환경 변수# 🎜🎜#

암호화 작업 수행:
[innpay@localhost tools]$ php encode_files.php
Source code path: /home/pony/php/apache2/htdocs/wechat_nofity
Destination code path: /home/pony/php/apache2/htdocs/des
Expire time: 2019-01-01 12:00:00------------- start process -------------PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/pony/php/soft/php-beast-master/tools/encode_files.php on line 147Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/pony/php/soft/php-beast-master/tools/encode_files.php on line 147Processed encrypt files [64%] - 100%Failed to encode file `/home/pony/php/apache2/htdocs/wechat_nofity/wechat.class.php'
Processed encrypt files [100%] - 100%
Finish processed encrypt files, used 0.699295 seconds
로그인 후 복사

여기에 wechat.class.php라는 파일이 암호화되지 않았다는 메시지가 표시됩니다. 길어도 상관없습니다. 성공하면 따로 복사하겠습니다.

암호화된 디렉터리는 des 디렉터리입니다. 들어가서 소스 코드 파일을 살펴보세요. 그러나 모든 PHP 페이지에 액세스하는 것은 정상입니다.

기본 암호화 키 수정

여기서는 des 암호화 방법을 사용하고 있으므로 반드시 des 키를 사용하겠습니다. 기본 키는 php-beast 디렉터리에 있습니다. 아래 des_algo_handler.c 파일:

#include <stdlib.h>#include <string.h>#include "beast_module.h"#include "des_algo_lib.c"static char key[8] = {    0x01, 0x1f, 0x01, 0x1f,    0x01, 0x0e, 0x01, 0x0e,
};
로그인 후 복사

을 직접 변경할 수 있으며 변경 후 다시 컴파일할 수 있습니다.

위 내용은 모두의 학습에 도움이 되기를 바랍니다. 더 많은 관련 내용은 PHP 중국어 홈페이지를 주목해주세요!

관련 권장 사항:

PHP 반복자 생성기 소개

방법 PHP
의 변수 세트에 배열의 값 할당

위 내용은 PHP 소스 코드 php-beast 암호화의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!