PHP code example of ethercap / passwd

1. Go to this page and download the library: Download ethercap/passwd library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ethercap / passwd example snippets


return [
    'modules' => [
        'passwd' => [
            'class' => '\ethercap\passwd\Module',
            //允许查看密码页面的用户id,可以为function
            'allowUserIds' => YII_DEBUG ? [1] : [1,2,3],
            //数据库加密的盐,建议由标点,大小写字母,数字组成
            'salt' => '#@!D1s^$&',
            //使用的数据库
            'db' => 'db',
            //加密方式,可以不配置,使用默认的加密
            'encodePasswd' => function($passwd, $key, $salt){
                return 'xxx';    
            }
            //解密方式,可以不配置,使用默认的解密
            'decodePasswd' => function($encrypt, $key, $salt) {
                return 'xxx',
            }
         ],
    ],
];