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
2
votes
1 answer

Cannot enable openssl extension for Composer after trying everything for hours! =(

When I try to use composer in command line, it keeps saying: "[Composer\Exception\NoSslException] The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this…
Ashley Liu
  • 453
  • 1
  • 7
  • 17
2
votes
0 answers

Unable to load dynamic library 'mongodb.so' - undefined symbol: OPENSSL_sk_num

I am trying to load mongodb.so module with Apache/2.4.6 on CentOS 7.3, the commands will tell you more about the versions of the packages I have managed to install so far. [root@SRVKL-04 ~]# httpd -v Server version: Apache/2.4.6 (CentOS) Server…
Yazid Erman
  • 1,166
  • 1
  • 13
  • 24
2
votes
0 answers

openssl_pkey_new returns false on windows php

I am using x64, PHP 7.0.4, Apache 2.4. I am trying to create a private and public key $config = array( "digest_alg" => "sha512", "private_key_bits" => 1024, "private_key_type" => OPENSSL_KEYTYPE_RSA, ); // Create the private and public…
Arya Same
  • 397
  • 1
  • 3
  • 12
2
votes
1 answer

Convert .net aes256 encryption code into php

The code below is a simple .NET snippet, having test on the input it returns p+cTm2VODfvQnreAl02wUQ== as an output. Dim aesEncryptObj As New System.Security.Cryptography.RijndaelManaged() Dim encoder As System.Text.ASCIIEncoding = New…
Stanimir Stoyanov
  • 1,623
  • 18
  • 29
2
votes
1 answer

How to get information about a keysize in php-openssl

I want to change the crypt-functions in my php-app from mcrypt to openssl. Now I'm missing a function like mcrypt_enc_get_key_size() in openssl? How do I can read the max. keysize of a cypher-method in openssl? Example:…
fischel
  • 106
  • 1
  • 5
2
votes
2 answers

SOAP with two certificates file and "Could not connect to host"

I have an issue connecting PHP with an API which requires using SSL certificates. The issue is when I run my PHP code I get "Could not connect to host". I was able to connect to the service provider using CURL like this : $wsdl =…
marvillous
  • 131
  • 1
  • 7
2
votes
1 answer

Undefined function openssl_encrypt() in Encrypter.php

I get the following error: Call to undefined function openssl_encrypt() in Encrypter.php line 73 It may seem obvious, but OpenSSL extension is enabled in my config, this error occurs only when using artisan serve, looked through config and it is…
gegham-ayvazyan
  • 41
  • 2
  • 12
2
votes
1 answer

Use openssl_encrypt to replace Mcrypt for 3DES-ECB encryption

I have an encryption method with mycrypt and the cipher is 3des, mode ecb: mcrypt_module_open ( MCRYPT_3DES, '', 'ecb', '' ) Now I want to encrypt it using openssl_encrypt, and I did not find des3-ecb in openssl_get_cipher_methods() list.
yiming.xie
  • 23
  • 1
  • 1
  • 7
2
votes
1 answer

PDO and openssl_public_decrypt failing

I am trying to decrypt and update password into a mysql database table. while doing it is giving me a weird error. PHP Warning: PDO::exec(): SSL operation failed with code 1. OpenSSL Error messages: error:0906D06C:PEM routines:PEM_read_bio:no…
sdhakal
  • 21
  • 2
2
votes
1 answer

PHP - Openssl_decrypt error : wrong final block length (AES 256 CBC mode encryption/decryption)

This is my code : function decrypt($code) { $key = '3552ef55ecdf04324..'; // 64 bytes length $iv = 'd20818af907b59c3b15d258dd3969770'; // 32 bytes length $key = hash("sha256", $key,true); // 32 bytes length $iv = md5($iv,true); //…
Jad.h94
  • 63
  • 2
  • 10
2
votes
1 answer

Warning while installing Composer on a Mac

My Mac has OpenSSL version 1.0.1t, but when I tried to install Composer, I got an error: Some settings on your machine may cause stability issues with Composer. If you encounter issues, try to change the following: The OpenSSL library (0.9.8zc)…
2
votes
2 answers

Read Owner Cert Data from .p12 file with PHP

I'm trying to get the owner info of a certificate with PHP. I have the .p12 file and when try to read the info with openssl PHP functions: if (getenv('HTTPS')=='on'){ $cert=$_SERVER['SSL_CLIENT_CERT']; }else{ …
Hanzo
  • 1,839
  • 4
  • 30
  • 51
2
votes
1 answer

Encrypting username and password using openssl_encrypt on client side?

I make API for PHP website and I need to send a login and user password in encrypted form. I chose the following method to decrypt: $decrypted = openssl_decrypt($user_login, 'bf-ecb', $client_id); Where $user_login is a string like a…
Kleyton
  • 65
  • 5
2
votes
1 answer

openssl_encrypt is not recognized by PHP

I can run openssl_encrypt ($string, $method, $pass); when I run it through php cmd. However when I run it via Apache http server it throw the following error: Fatal error: Uncaught Error: Call to undefined function openssl_encrypt() in…
Saeid Raei
  • 128
  • 2
  • 12
2
votes
0 answers

Php and OpenSsl

I should execute the following openssl command on a host server with the php support and the php-openssl extension enabled. openssl.exe smime -verify -inform DER -in $p7m_file -noverify -out $out_file What's the equivalent php code of the above…