首页 > 解决方案 > Laravel 6:使用 virgil/crypto 加密错误:调用未定义函数 vscf_ctr_drbg_new_php

问题描述

我正在尝试使用https://github.com/VirgilSecurity/virgil-crypto-php像这样在 Laravel 宅基地中使用公钥/私钥加密/解密数据

composer require virgil/crypto

use Virgil\Crypto\VirgilCrypto;
// inside the function:
$crypto = new VirgilCrypto();
$receiverKeyPair = $crypto->generateKeyPair();

然后安装SDK https://github.com/VirgilSecurity/virgil-sdk-php

composer require virgil/sdk
./vendor/virgil/crypto-wrapper/_extensions/setup.sh -all -vendor

我可以vsce_phe_php, vscf_foundation_php, vscp_pythia_php在运行php -m命令后看到这些扩展,但我得到了

Call to undefined function Virgil\CryptoWrapper\Foundation\vscf_ctr_drbg_new_php() {"exception":"[object] 
(Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to undefined function 
Virgil\\CryptoWrapper\\Foundation\\vscf_ctr_drbg_new_php() at 
/home/vagrant/code/my-project/vendor/virgil/crypto-wrapper/src/Foundation/CtrDrbg.php:63)

在包中的任何地方都找不到此中的所有功能,我该如何解决?

标签: phpencryptionlaravel-6homestead

解决方案


推荐阅读