zoukankan      html  css  js  c++  java
  • screw-plus实现php代码安全

    1.下载screw-plus安装包

    git clone https://git.oschina.net/splot/php-screw-plus.git
    mv php-screw-plus /usr/local/src/

    2.php添加php-screw-plus模块,在编译之前可以在php_screw_plus.h文件指定CAKEY,最好选择一个足够复杂的16位的key值,提高加密复杂度

    /usr/local/php/bin/phpize
    
    # 编译解密程序
    ./configure --with-php-config=/usr/local/php/bin/php-config
    make && make install
    
    # 编译加密程序
    cd tools/
    make
    
    # 修改php配置文件,指定扩展路径
    vim /usr/local/php/etc/php.ini
    # 这样写是需要有extension_dir的,建议添加这个,方便之后指定扩展路径
    extension = php_screw_plus.so

    3. 重启php,查看模块

    service php-fpm restart
    # 有内容就表示扩展成功
    php --re php_screw_plus

    4.测试加密

    mkdir /test
    
    vim /test/test.php
    <?php
    phpinfo()
    ?>
    
    # 加密/test目录下的所有php文件
    cd /usr/local/src/php_screw_plus/tools
    ./screw /test
    
    # 查看是乱码,就表示加密成功
    cat /test/test.php
  • 相关阅读:
    hdu2089 不要62
    hdu4734 F(x)
    hdu3555 Bomb
    hdu3652 B-number
    hdu4352 XHXJ's LIS
    CodeForces 55D Beautiful numbers
    数位dp模板
    欧拉函数模板
    UVALive
    常用正则表达 (转)
  • 原文地址:https://www.cnblogs.com/chenpingan/p/10631679.html
Copyright © 2011-2022 走看看