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

mcrypt_create_iv returns undefined variable

My encryption/iv code doesn't work. Whenever I test the login I get this error Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended in /Users/luke/Sites/user.php on line 174 I have…
fancy_duck6
  • 157
  • 1
  • 9
2
votes
2 answers

Verify JWT signature with RSA public key in PHP

In PHP, I'm trying to validate an AWS auth token (JWT returned from getOpenIdTokenForDeveloperIdentity) using the AWS's RSA public key (which I generated from modulus/exponent at https://cognito-identity.amazonaws.com/.well-known/jwks_uri). The key…
BStaven
  • 37
  • 1
  • 3
2
votes
1 answer

Billing App and "openssl_verify(): supplied key param cannot be coerced into a public key"

I'm trying to test my server side IAB signature verification method. I want to use my public and private key (not the ones from Google), so I'm faking a receipt and signing it with id_rsa.pub: openssl dgst -binary -sha1 -sign /Users/user/.ssh/id_rsa…
Jumpa
  • 4,319
  • 11
  • 52
  • 100
2
votes
1 answer

PHP OpenSSL extension not working while installing TYPO3 CMS 7.4.0

While installing TYPO3 CMS 7.4.0 I get the message: 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 if it is installed…
2
votes
1 answer

Get list of PHP openssl_encrypt methods / modes

I am starting to use PHP's openssl_encrypt method. The second argument is the encryption mode. Where can I find a list of all possible methods / modes?
Saturn
  • 17,888
  • 49
  • 145
  • 271
2
votes
1 answer

Export OpenSSL public key to file

How can I export only the public key to a file(.pem) with PHP? Of course it is possible to export the whole certificate and a private key but I can't find a solution to export a public key. The file should look like -----BEGIN PUBLIC…
alve89
  • 971
  • 1
  • 9
  • 31
2
votes
0 answers

How to decode a rc2 cyphertext that has been encoded in base64 with an IV?

I continue to get bad magic number. I do not know what this means. here is what I am inputting to the CLI: openssl enc -d -rc2-cbc -base64 -k AUvS8jou0Z9K7Bf9 -iv 6f73575664616a4f0d0a -in input.enc -out output.dec inside of the input.enc I…
Kevin
  • 3,077
  • 6
  • 31
  • 77
2
votes
4 answers

Handling "The openssl extension is missing: in XAMPP

I tried to Install composer on my PC (Windows 8 Pro 64x and XAMPP 3.2.1), so I downloaded Windows Installer and run it But I got this error: The openssl extension is missing, which means that secure HTTPS transfers are impossible. I searched about…
Ali Lotfi
  • 856
  • 3
  • 18
  • 40
2
votes
3 answers

openssl_sign(): supplied key param cannot be coerced into a private key

I have googled to search answer for these problem.but I'm not able to find proper solution for my question as many answer was specific to problem related. when I tried to create digital signature of content using XMLSecurityKey and openssl_sign I'm…
stefun
  • 1,261
  • 3
  • 24
  • 54
2
votes
1 answer

openssl_free_key expects parameter 1 to be resource

I have this code: openssl_pkcs12_read($p12buf, $p12cert, $decPass); openssl_pkey_export($p12cert['pkey'], $pemkey); openssl_sign($toSign, $signature, $pemkey, OPENSSL_ALGO_SHA1); openssl_free_key($pemkey); I get this warning: Warning (2):…
uldo
  • 19
  • 2
  • 8
1
vote
2 answers

PHP openssl_decrypt error after MySQL upgrade

I have a PHP class that handles encryption and decryption which stopped decrypting recently after a MySQL upgrade from 5.7 to 8 and migration to a new server. I need to decrypt the data in the database that was encrypted using the encrypt function…
ddavidd
  • 11
  • 4
1
vote
0 answers

MAMP 3.5 Mac Update SSL

I try to upgrade OpenSSL from 0.9.8 to 1.1.1t With brew, I updated curl with no problem after reading those explications (https://github.com/lunr/mamp-curl-tls). But even if curl library has been updated, I didn't found how to update openssl. My…
Flex60460
  • 933
  • 2
  • 18
  • 49
1
vote
1 answer

Validating an RSA PKCS#1v1.5 SHA 256 signature with an RSA 2048 public key

I have a public key stored in the database as a string. The generating library says that it is an RSA 2048 public key. Here is an example of the public key as it is…
paran
  • 69
  • 8
1
vote
1 answer

Nodejs how to implement OpenSSL AES-CBC encryption (from PHP)?

I am currently working on translating an encryption algorithm from PHP to Typescript, to use in a very specific API that requires the posted data to be encrypted with the API key and Secret. Here is the provided example of how to correctly encrypt…
thim24
  • 624
  • 1
  • 5
  • 14
1
vote
1 answer

Encrypt on PHP and Decrypt on Javascript

Recently I am trying to find a way to encrypt data on PHP with a Public Key generated on javascript using window.crypto.subtle.generateKey() async function GenerateKeys() { let key = await window.crypto.subtle.generateKey( { …
Faety
  • 13
  • 3