encrypt($data) Crypt::blockCipher()->decrypt($data) * User: llbjj * DateTime: 2022/5/5 18:48 * * @return BlockCipher */ static function blockCipher() { $blockCipher = BlockCipher::factory('openssl', ['algo' => 'aes', 'mode' => 'gcm']); $blockCipher->setKey('ae60e54db83a30ea985fcd77b14c063320922864a584c5dfb96e77d84e7317aa'); return $blockCipher; } /** * Notes: 获取加密字符串 * User: llbjj * DateTime: 2022/5/5 19:12 * * @param string $data * @return string */ static function createKey(string $data = 'YikeenEDC') { $salt = Rand::getBytes(32, true); $key = Scrypt::calc($data, $salt, 2048, 3, 1, 32); return bin2hex($key); } }