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

AES encryption in php and decrypt in perl

My perl script is not to decrypt a AES encrypted string in php I think I am missing something here , Are there any sample scripts available to decrypt in perl with an IV This is the Encrypt script in php
Ram
  • 1,155
  • 13
  • 34
3
votes
2 answers

Recompile PHP with OpenSSL on CentOS

I have upgraded openssl version to 1.02l from 1.0.1e and PHP version from PHP 5.6 to PHP 7.1.8 (PHP is installed using yum) The problem is, PHP still detects openssl version to 1.0.1e whereas I want it to be updated to latest openssl version…
Ibrahim Azhar Armar
  • 25,288
  • 35
  • 131
  • 207
3
votes
0 answers

openssl_pkey_new doesn't work in xampp

I have googled and studied openssl for several days, and have not found a solution to the problem with openssl_pkey_new in XAMPP for windows. Have tried both ver. 7.1.1 and 7.1.4. Each time i try to run this code: echo…
gerteb
  • 121
  • 1
  • 12
3
votes
1 answer

Can't decrypt using pgcrypto from AES-256-CBC but AES-128-CBC is OK

I have problem decrypting data in pgcrypto that was previously encrypted in PHP app. I tried 3 types of encryption: 1) mcrypt - RIJNDAEL 128 CBC 2) mcrypt - RIJNDAEL 256 CBC 3) openssl_encrypt - aes-256-cbc everything is encrypted decrypted fine in…
R A
  • 827
  • 13
  • 25
3
votes
5 answers

Openssl equivalent to mcrypt_get_block_size

I am currently in the process of replacing Mcrypt with OpenSSL since Mcrypt will be deprecated in PHP 7.1. I need is a way to get the blocksize per algorithm like mcrypt_get_block_size(). I am wondering if there is an equivalent function to…
herriekrekel
  • 571
  • 6
  • 15
3
votes
4 answers

openssl_encrypt returns false

I am trying to encrypt a string using openssl_encrypt in PHP but it keeps returning FALSE. $encrypted = openssl_encrypt('1234', 'AES-256-CBC', 'kGJeGF2hEQ', OPENSSL_ZERO_PADDING, '1234123412341234'); What am I doing wrong?
dasj19
  • 177
  • 1
  • 3
  • 10
3
votes
2 answers

Why can't openssl_public_encrypt handle this plaintext?

openssl_public_encrypt apparently can't handle arbitrary plaintexts.
spraff
  • 32,570
  • 22
  • 121
  • 229
3
votes
2 answers

How to upgrade openssl 0.9.8 to 1.0.2 with mod_ssl in Apache 2.2.9

I am asked to recompile mo_ssl with openssl 1.0.2 in SuseSE11SP3. However, I am a newbie to Suse, but know a little bit of linux. OS : Suse SE11SP3 Openssl : 0.9.8j <-which comes with original Suse linux Web Server : Apache httpd 2.2.9 Here is…
CharlieSiNB
  • 90
  • 1
  • 1
  • 10
3
votes
0 answers

Not able to enable openssl in PHP 5.6.22

I was running my application on XAMPP and PHP 5.4.19, as I tried upgrading to PHP 5.6.22, I am not able to enable the openssl. Downloaded Thread Safe binary from here : http://windows.php.net/downloads/releases/php-5.6.22-Win32-VC11-x86.zip I…
3
votes
1 answer

OSX - Composer - lib-openssl requirements

Since the last XCode Update to version 7.3.1 i run into problems with composer and openssl on OSX. It worked before update. I try to update packages via composer update. The package "ricardoper/twitteroauth" requires lib-openssl: "*". The following…
Mirko
  • 43
  • 5
3
votes
1 answer

Pass string instead of file to openssl_pkcs7_sign()

I am looking into php openSSL library and need to sign a string using pub and priv key. The function openssl_pkcs7_sign() from documentation it seem to take the file path as a file parameter but I have string in a variable that I need to encrypt. I…
Sisir
  • 2,668
  • 6
  • 47
  • 82
3
votes
0 answers

Is there a reason to prefer openssl_pkey_get_private over loading it in memory?

I'm wondering why there are different ways to use the openssl functions in PHP: pass a key as string (e.g. load it using file_get_contents(), or store it in an env variable) pass a key file as a filename: file:///var/keys/private_key load the key…
Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
3
votes
1 answer

why doesn't message signed with openssl_pkcs7_sign validate with openssl_pkcs7_verify?

The signing code is based off of the example at http://php.net/openssl-pkcs7-sign. The private key corresponds to the public key in the cert. The cert is valid from one year ago to Dec 31, 9999, so the date range isn't an issue. Does the key usage…
neubert
  • 15,947
  • 24
  • 120
  • 212
3
votes
2 answers

Google Cloud SQL SSL fails peer certificate validation

I have an issue using MySQL on PHP 5.6, and after three days of debugging PHP, OpenSSL, MySQLnd Drivers on PHP and trying out the mysql_client on an Ubuntu 14.04 machine, I have come to a conclusion: Google Cloud SQL SSL certificates will not work…
watonlyme
  • 43
  • 1
  • 6
3
votes
1 answer

OpenSSL version for Heartbleed

How does one check the version of OpenSSL for the Heartbleed vulnerability on CentOS systems, and what is the procedure for manually updating it?
JoshuaDavid
  • 8,861
  • 8
  • 47
  • 55