推荐使用 php-bease 这个免费开源方案。
有一说一,这个项目上次更新时间是2021年…
多好的项目呀。
作者说在 php5.1 ~ php7.2 上都测试过。
源码地址:
-
C源码: https://github.com/liexusong/php-beast
-
dll版: https://github.com/imaben/php-beast-binaries/tree/master/php72
Windows上使用
安装
安装(编译)过程就没有了, dll 都给你了,丢到 ext 目录里,再在 php.ini
里加载它就行
使用
源码库里提供了 ./tools/encode_files.php
脚本文件 和 配套的 configure.ini
填一下 configure.ini
:
; source path
src_path = "F:\\Export\\source"
; destination path
dst_path = "F:\\Export\\source_Encrypt"
; expire time
expire = "2099-12-31 23:59:59"
; encrypt type
encrypt_type = "DES"
然后跑一下encode_files.php
脚本
# Shell
cd F:
cd php-beast-master\tools
D:/php7/php.exe -c D:/php7/php.ini ./encode_files.php