Questions tagged [php-openssl]

Using this extension, PHP can use some OpenSSL functions to do direct encryption. This tag should not be used for questions about encrypting traffic(HTTPS)

The OpenSSL extension for PHP uses the functions of (OpenSSL) for generation and verification of signatures and for doing full encryption and decryption of data. This module does not support the full suite of OpenSSL functions, but does offer access to actively maintained encryption libraries as opposed to deprecated libraries like .

For hashing (one-way encryption) check out

405 questions
3
votes
1 answer

CentOS 5.10 can't enable php-openssl extension

I have installed CentOS 5.10 on my server and PHP 5.4.17, but the problem is that I can't enable php-openssl extension. By the command 'locate openssl' looks like the extension exists, so I tried to create the openssl.ini file in '/etc/php.d/' but…
gintko
  • 697
  • 8
  • 16
3
votes
2 answers

Slow performance when generating CloudFront Signed URLs

I'm following this sample to create Signed URLs on CloudFront using PHP http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CreateURL_PHP.html And I have everything working fine and generating the Signed URLs for both RTMP…
Guillermo
  • 864
  • 4
  • 12
  • 20
3
votes
1 answer

PHP server-side SNI support

I read a lot of php manpages but only found information about SNI support in contexts - http://www.php.net/manual/en/context.ssl.php Is it possible to obtain SNI send by browser when PHP is working as a server? Server is created using standard…
kiler129
  • 1,063
  • 2
  • 11
  • 21
3
votes
1 answer

PHP server side IAB verification openssl_verify always returns 0

I'm using the following function (server side php) to verify a IAB v3 transaction: I'm passing from the android app: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { String…
Diego
  • 4,011
  • 10
  • 50
  • 76
2
votes
2 answers

Cannot compile PHP 7.4.30 on Ubuntu 22.04LTS

I have an issue trying to manually compile PHP 7.4.x on Ubuntu Server 22.04LTS. There seems to be a compatibility problem between PHP 7.4 and OpenSSL 3.0 as the php compilation fails with various OSSL_DEPRECATEDIN_3_0 errors. If PHP7.4 has no…
paj
  • 1,177
  • 16
  • 33
2
votes
2 answers

Trying to understand &$signature parameter in openssl_sign

I'm trying to understand -> https://www.php.net/manual/en/function.openssl-sign.php which has &$signature parameter. I read this -> PHP &$string - What does this mean? but still don't understand why must we have &$signature as a parameter or how do…
ratib90486
  • 89
  • 1
  • 7
2
votes
1 answer

Under what circumstances does PHP's openssl_random_pseudo_bytes return false?

The PHP documentation for openssl_random_pseudo_bytes says: Return Values Returns the generated string of bytes on success, or false on failure. What would cause openssl_random_pseudo_bytes to fail? Can this be manually triggered for testing…
CJ Dennis
  • 4,226
  • 2
  • 40
  • 69
2
votes
2 answers

Can't AES_DECRYPT (MySQL) a string encrypted with openssl_encrypt (PHP)

I'm using a PHP script to encrypt strings using "aes-256-cbc" cipher. Those strings are stored in a MySQL database and I would like for MySQL to decrypt them. Here is my PHP encrypting function : function encrypt($token) { if($token !== "" &&…
Cephou
  • 257
  • 5
  • 23
2
votes
1 answer

openssl_encrypt aes 256 with hash in java

From the php encryption function below: $data = "1212312121447"; $cipher = "aes-256-ofb"; $secretKey = "aNdRgUjXn2r5u8x/A?D(G+KbPeShVmYp"; $ivLength = openssl_cipher_iv_length($cipher); $keyOfb = substr(hash('sha256', $secretKey, true), 0,…
Pim H
  • 223
  • 2
  • 8
2
votes
1 answer

decryption works using PHP (openssl) and not working using javascript (cryptojs)

Decryption works using php/openssl and I can get my plain data. Here is the defined call:
Abdelaziz Dabebi
  • 1,624
  • 1
  • 16
  • 21
2
votes
2 answers

Delphi 7 - Encrypt with DEC, and decrypt with PHP OpenSSL

Using: Delphi 7, DEC v5.2 Please refer to this question: Delphi 7 - DCPCrypt - TDCP_rijndael - DecryptString - How to make it work? From @AmigoJack's excellent answer, I have the Delphi Decrypt function working fine. Based on that, I am now trying…
Steve F
  • 1,527
  • 1
  • 29
  • 55
2
votes
1 answer

CryptoJS and openssl_decrypt not produce same result

I am trying to implement AES 256 bit encryption with string on php and JavaScript. For jasvascript I a musing CryptoJS and php I use openssl_decrypt/enecrypt. Below is the code in JS for encryption and decryption. JavaScript function…
CodeDezk
  • 1,230
  • 1
  • 12
  • 40
2
votes
1 answer

Valid function showing unvalid

In phpstorm php 7.4 I am using the following function below, it seems to function as it should but I get the following EA error in console on line 551 [EA] The IV generated can be false, please add necessary checks. [EA] Use 2nd parameter for…
Da' Don
  • 41
  • 5
2
votes
1 answer

nothing provides libcrypto.so.1.0.0(OPENSSL_1.0.0)(64bit)

I ran over a sles 12 server and i got this issue when I try to install php7-openssl-7.2.13-155.1.x86_64.rpm : zypper in ./php7-openssl-7.2.13-155.1.x86_64.rpm Loading repository data... Reading installed packages... Resolving package…
Fardouk
  • 21
  • 1
  • 3
2
votes
2 answers

How can I encrypt and decrypt a string in php?

According to this tutorial https://www.the-art-of-web.com/php/two-way-encryption/ I try to encrypt and decrypt a string. The encryption works well: $token = "The quick brown fox jumps over the lazy dog."; $cipher_method = 'aes-128-ctr'; …
peace_love
  • 6,229
  • 11
  • 69
  • 157