PHP code example of ssphp / sskey

1. Go to this page and download the library: Download ssphp/sskey 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/ */

    

ssphp / sskey example snippets



�始化key和iv,路径由运维配置
sskey_init(__DIR__.'/vendor/ssphp/sskey/tests/sskeyStarter.php');

$password = sskey_encrypt('ssphp');
var_dump($password);
$key = sskey_decrypt($password);
var_dump($key);

$password = sskey_encrypt('sskey');
var_dump($password);
$key = sskey_decrypt($password);
var_dump($key);


//在config.php或user_config.php的最后添加以下代码
sskey_init(__DIR__.'/lib/sskey/tests/sskeyStarter.php');
sskey_decrypt_msvc($config);


//在bootstrap/app.php脚本的引入配置文件之后添加以下代码
sskey_init(__DIR__.'/../vendor/ssphp/sskey/tests/sskeyStarter.php');
sskey_decrypt_lumen($config);	//$config是引入的配置文件,例如:$config = ['app', 'database'];