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
118
votes
18 answers

How to enable PHP's openssl extension to install Composer?

I am trying to install Laravel in WAMP setup. I am getting a warning message for not enabling openssl which I had already done in WAMP. Here is a screenshot of the message.
FirmView
  • 3,130
  • 8
  • 34
  • 50
26
votes
5 answers

What is an openssl iv, and why do I need a key and an iv?

I am about to use the following script to encrypt and decrypt some data. I am using it because my current encryption does not work on our new server. We are currently using mcrypt so I want to change to openssl. In our database we use aes encryption…
25
votes
4 answers

Correct way to use php openssl_encrypt

I'm working with cryptography on a project and I need a little help on how to work with openssl_encrypt and openssl_decrypt, I just want to know the most basic and correct way to do it. Here is what I got so far: // To encrypt a…
Jo E.
  • 7,822
  • 14
  • 58
  • 94
20
votes
4 answers

How to encrypt data in php using Public/Private keys?

I have a small string of some data (less than 1kb) that I would like to have user agents pass to other sites when they are sent from my site. In order for the other sites to verify that I was the one that created the string I though of two…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
19
votes
6 answers

Call to undefined function Illuminate\Encryption\openssl_decrypt()

I am using xampp and windows along with laravel, everything was working fine, but when I finished work and turned of xampp and try to open my work today morning, this is what I get: FatalThrowableError in Encrypter.php line 100: Fatal error: Call to…
Przemek Wojtas
  • 1,311
  • 5
  • 26
  • 51
18
votes
6 answers

PHP OpenSSL extension not working while installing TYPO3 6.2.2 on Windows 7

I've installed TYPO3 6.2.2 on Windows 7 but I got an error message as below: PHP OpenSSL extension not working Something went wrong while trying to create a new private key for testing. Please check the integration of the PHP OpenSSL extension and…
user3471037
  • 181
  • 1
  • 1
  • 4
15
votes
3 answers

MCrypt rijndael-128 to OpenSSL aes-128-ecb conversion

Since Mcrypt is deprecated, I want to use OpenSSL instead in my code since we already using php 7.0.17 in our server and there's no tell when they upgrade it. Some third party API (hosted on PHP 5.x probably and using mcrypt), is taking encrypted…
Jamshad Ahmad
  • 410
  • 1
  • 6
  • 16
14
votes
4 answers

OpenSSL Error messages: error:0A000126:SSL routines::unexpected eof while reading

Screenshot is here I have built a website in PHP using the YII2 framework. When I use file_get_contents($requestUrl, false, stream_context_create($arrContextOptions)) then i am getting error saying error:0A000126:SSL routines::unexpected eof while…
Salik Mohammad
  • 141
  • 1
  • 1
  • 5
13
votes
1 answer

How to encrypt plaintext with AES-256 CBC in PHP using OpenSSL?

I am trying to encrypt sensitive user data like personal messages in my php powered website before entering into the database. I have researched a bit on the internet and I have found the few important things to remember: Never use mcrypt, it's…
DASH
  • 181
  • 1
  • 2
  • 10
13
votes
3 answers

Cryptographically secure unique id

I want to generate cryptographically secure unique uuids using php. uniqid() provides unique but not secure ids and openssl_random_pseudo_bytes() provides secure but not unique ids. Is the combination of the two(following code) a proper approach or…
Stavros
  • 655
  • 7
  • 16
12
votes
3 answers

Convert encrypt and decrypt C# function to PHP function

I would like to convert C# function to PHP function. Here is link to Function in C# : https://stackoverflow.com/a/19441805/3581428 public static string Encrypt(string clearText) { string EncryptionKey = "MAKV2SPBNI99212"; byte[] clearBytes =…
user3581428
  • 173
  • 1
  • 1
  • 9
12
votes
2 answers

mcrypt_encrypt to openssl_encrypt, and OPENSSL_ZERO_PADDING problems

I have this mcrypt_encrypt call, for a given $key, $message and $iv: $string = mcrypt_encrypt(MCRYPT_3DES, $key, $message, MCRYPT_MODE_CBC, $iv); I'd like to change the mcrypt_encrypt call to an openssl_encrypt one, to future-proof this. By having…
yivi
  • 42,438
  • 18
  • 116
  • 138
11
votes
1 answer

Using OPENSSL_RAW_DATA param in openssl_decrypt with php 5.3

My company is implementing V.me checkout on our site. Visa has provided us with a file of php helper functions for decrypting data, but one of them uses openssl_decrypt with the OPENSSL_RAW_DATA parameter, which only became available in PHP…
EmmyS
  • 11,892
  • 48
  • 101
  • 156
11
votes
2 answers

How do I keep my cacert.pem current for security reasons when using curl?

I would like to keep my root certificates current for use with cURL and PHP's internal curl command, however there is no parameter currently to download the current file it requires for a proper secure connection and to keep it current. And example…
Kraang Prime
  • 9,981
  • 10
  • 58
  • 124
9
votes
3 answers

how to fix SSL certificate verification failure

I use PHPMailer, along with Apache and PHP, locally. When I test my SSL config and my cacerts I get default_cert_file = C:\Program Files\Common Files\SSL/cert.pem default_cert_file_env = SSL_CERT_FILE default_cert_dir = C:\Program Files\Common…
slevin
  • 4,166
  • 20
  • 69
  • 129
1
2 3
26 27