Webiny\Component\Crypt\Crypt::decrypt PHP Method

decrypt() public method

In order to decrypt the string correctly, you must provide the same secret key that was used for the encryption process.
public decrypt ( string $string, string $key ) : string
$string string The string you want to decrypt.
$key string The secret key that was used to encrypt the $string.
return string Decrypted string or false if unable to decrypt (wrong key).
    public function decrypt($string, $key)
    {
        try {
            return $this->driverInstance->decrypt($string, $key);
        } catch (\Exception $e) {
            throw new CryptException($e->getMessage());
        }
    }

Usage Example

コード例 #1
0
ファイル: Crypt.php プロジェクト: Webiny/Framework
 /**
  * Decrypts the given $string that was encrypted with the $key.
  *
  * @param string $string Encrypted string.
  * @param string $key    Key used for encryption.
  *
  * @return string Decrypted string.
  */
 public function decrypt($string, $key)
 {
     return $this->serviceInstance->decrypt($string, $key);
 }
All Usage Examples Of Webiny\Component\Crypt\Crypt::decrypt