419 questions
4
votes
1
answer
140
views
How to decrypt a value in Python that was encrypted using PHP openssl
I have a value that was encrypted using PHP openssl using cipher AES-CBC-256 but the passphrase for the final value was also encrypted using the same method. openssl_encrypt($key, $cipher, $passphrase,...
1
vote
1
answer
207
views
Proper approach to encrypt large files that cannot be completed in a single function call?
I've been experimenting (from the CLI) with the encryption examples at https://www.php.net/manual/en/function.openssl-encrypt.php
and would like to know how to handle a larger file, such as a SQLite ...
1
vote
1
answer
202
views
FPDF's SetProtection script password protecting since Amazon Linux 2023
We have been using FPDF on our AWS EC2 instances for many years and for some of the documents, we use the SetProtection script to encrypt them, allowing only "print" as the possible option.
...
0
votes
0
answers
36
views
implement volume payment API using PHP
I'm trying to implement a payment using a Volume webhooks.
I'm getting some errors on prodution machine:
error:0480006C:PEM routines::no start line
error:02000068:rsa routines::bad signature
error:...
0
votes
0
answers
77
views
Trying to verify a signature using openssl_pkey_get_public()
I'm trying to verify a signature using the Volume API for make a payment. According to them, I need to,
To verify the signature, consume the original, unmodified payload sent from Volume and verify it ...
0
votes
0
answers
76
views
Encrypt in Python, Decryp in PHP using AES/OpenSSL
I am struggling with encrypting a string in python and decrypting the result in PHP. Here is what I do:
from Crypto.Cipher import AES #pycryptodome
from base64 import b64encode,b64decode
plainData = ...
-1
votes
1
answer
165
views
PHP function openssl_encrypt cipher operation failing
I have a PHP script that will encrypt data to store in a database, but when I run the script, the openssl_encrypt returns false with the error: "error:1C800066:Provider routines::cipher operation ...
0
votes
0
answers
105
views
XAMPP, Apache crashes when OpenSSL extension is enabled in php.ini
When i enable extension=openssl in my php.ini and restart apache, the apache crashes with the following error:
[Fri Jun 21 17:49:05.001805 2024] [ssl:warn] [pid 15484:tid 720] AH01909: www.example....
2
votes
1
answer
343
views
how to create CSR in PHP?
I am trying to create CSR using PHP and OpenSSL extension,
but when I do that it gives me an error which says:
Failed to generate private key: error:2006D080:BIO
routines:BIO_new_file:no such file
...
1
vote
1
answer
549
views
Laravel - How to Encrypt and Decrypt Large Files in Chunks?
I was initially encrypting files directly without using chunks and started encountering an error when trying to encrypt large files:
Allowed memory size of 134217728 bytes exhausted
After some ...
0
votes
0
answers
153
views
PHP Sodium Encryption/Decryption Fails Despite Consistent Configuration and Keys
I'm experiencing an issue with PHP Sodium encryption and decryption. Despite ensuring that the keys, configuration, and environments are consistent, decryption consistently fails.
PHP Version 8.2
...
0
votes
0
answers
80
views
PHP openssl lib / ECDSA / How set random number for openssl_sign function?
How set (or get after signing) random number for function openssl_sign?
$pkEcPem = "-----BEGIN EC PRIVATE KEY-----302e0201010420...a00706052b8104000a-----END EC PRIVATE KEY-----"
$pk = ...
0
votes
1
answer
879
views
In PHP openssl, how to get public certificate PEM for website?
To get the public certificate (PEM) for a website in FireFox, I do this:
Go to website, eg., https://stackoverflow.com , and click on padlock icon in address bar.
Click on Connection secure -> ...
0
votes
0
answers
155
views
Verify signed data using PHP openssl with RSA SHA1
I am trying to verify signed data response using php openssl.
I am using php openssl verify method but i cant get it to verify even though the signed data is valid
I tried the following
<?php
$data=...
0
votes
2
answers
692
views
Encrypt in JS and Decrypt in PHP using AES encryption algorithm in GCM and Base64 encoding
I am try to Encrypt data in JS and Decrypt it in PHP using AES encryption algorithm in GCM and Base64 encoding. But during decryption I always get false as result without any openssl error. I have ...
2
votes
2
answers
521
views
How to sign data in Javascript and verify the signature in PHP?
I have a simple string of text that needs to be signed inside a Javascript and verified on the server (PHP). To start my test I first created a key pair:
// Function to generate a new RSA key pair
...
1
vote
1
answer
150
views
Rewrite a function from python to php
I need to implement file decryption in php. As a result of my attempts, I get a broken archive
I use the code as a basis https://github.com/samloader/samloader/tree/master
I'm interested in the part
...
1
vote
1
answer
140
views
AES/ECB/NoPadding Decryption not working with PHP OpenSSL
Encrypted Value : 673a487f841c4c0b405cb3fee05b3385
Encryption Key : Y4IC99u0pqLKIrpr
Decryption Value : 96895018020
We tried with below Java Code & it is working.
public class oomaHeDecryption {
...
2
votes
1
answer
297
views
create php code for large files openssl encrypt using AES-256-CTR compatible with openssl command line
I am trying to create a PHP method to replicate the OpenSSL command line function so I can encrypt using PHP and then decrypt it using command line .
i created PHP method for encrypting files taking ...
0
votes
0
answers
102
views
replicate openssl encrypt/decrypt between PHP and Command Line for large files?
I am trying to create a PHP method to replicate the OpenSSL command line function so I can encrypt using the command line and then decrypt it using PHP or the opposite by encrypting using PHP and then ...
1
vote
0
answers
234
views
How to replicate openssl encrypt/decrypt between PHP and Command Line?
I am trying to create a PHP method to replicate the OpenSSL command line function so I can encrypt using the command line and then decrypt it using PHP or the opposite by encrypting using PHP and then ...
-1
votes
1
answer
339
views
Enabling openssl module after successful instillation
I am trying to enable openssl encryption for php 8.2 using macports so that I can use composer to download the required php libraries for google api's.
I'm attempting to install the required php ...
0
votes
0
answers
632
views
OpenSSL required for laravel project, enbaled in php.ini, but not working?
In Factory.php line 648:
The openssl extension is required for SSL/TLS protection but is not availab
le. If you can not enable the openssl extension, you can disable this error
, at your own risk, by ...
0
votes
1
answer
750
views
Fatal error: Uncaught GuzzleHttp\Exception\ConnectException: > Connection refused for URI https://www.googleapis.com/oauth2/v3/certs
I have a very big problem with my connection in my web app.
First of all the app is in progress so I use the localhost to test my php code.
I wanted to use the Google api to connect users so I use :
...
2
votes
2
answers
239
views
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 ...
0
votes
0
answers
486
views
PHP and JavaScript Data Encryption and Decryption
A short description:
A JavaScript receives from a PHP-Script a RSA-Public-Key, the private-key will be stored.
In the JavaScript script, some data is encrypted and then passed to a PHP script that ...
1
vote
0
answers
98
views
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 ...
3
votes
0
answers
1k
views
How is it possible to install openssl and curl extension for PHP8 on mac?
I installed PHP 8 with:
brew install php
Then I edited php.ini to enable curl and openssl:
extension=curl
extension=openssl
I use the default extension dir
extension_dir = "/opt/homebrew/lib/...
0
votes
0
answers
345
views
openssl_pkey_new always return false with alpine 3.17
I'm trying to move from Alpine 3.16 to 3.17 which comes with a breaking change of OpenSSL from v1.1.1 to v3.x.
This method openssl_pkey_new always fails on Alpine 3.17 and is not able to apply key ...
0
votes
1
answer
322
views
php-extension php7-mod-* not load in OpenWrt
I got Fatal error: Uncaught Error: Call to undefined function openssl_decrypt() message in my lighttpd using php file.
I already have php7-mod-openssl, but php-cli -m not showing openssl.
OpenWrt ...
2
votes
1
answer
2k
views
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 stored:
...
0
votes
1
answer
399
views
PHP openssl_private_encrypt() Fails With secp521r1 EC Private Key
Context
On a webserver, I am trying to sign a small piece of data (an email address) with a private key. This signature will later be verified with the public key.
I've generated a secp521r1 private ...
1
vote
1
answer
389
views
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 ...
0
votes
1
answer
81
views
converting a decode aes 128 python script to php fails with error:0606506D:digital envelope routines
I have a python script that works like expected and I tried to convert it to php without success.
The python code looks like this and is running as expected. I can get the results
Decrypted PICCData: ...
1
vote
1
answer
663
views
How to replace mcrypt with openssl?
I am currently upgrading an existing PHP application from PHP 5.4 to PHP 8.1. I have managed to restore all functionality except for encryption and decryption of data. My application communicates with ...
-1
votes
1
answer
365
views
Encrypt large inputs in PHP using OpenSSL and a password-protected SSH key?
I have a CLI tool that writes encrypted data to the local filesystem that is never transmitted over the network.
I am able to encrypt the data using a password-protected SSH key, but since the ...
0
votes
1
answer
816
views
Implement PHP method openssl_encrypt "AES-256-CBC" OPENSSL_RAW_DATA in C#
I'm implementing a third party API that asks me to encrypt the payload of a POST request "as done in this PHP example":
class RESTfulAPI {
function __construct($DomainOrIP, $Key,...
0
votes
2
answers
302
views
ERROR - Unable to load signing key. Can't sign my text with my Private Key - PHP
I can't instanciate my $pemkey whit a relative path in my php code. When I try to instanciate my key with openssl_pkey_get_private the program doesn't find it.
Here is my code :
$pemkey = ...
1
vote
1
answer
936
views
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....
0
votes
1
answer
317
views
Converting openssl_public_encrypt (PHP) in C# code
So I have to convert some PHP code to C# and my PHP code does following:
if (null === $date)
$date = time();
$plain = "user:{$login};system:{$system};date:{$date};";
if (...
1
vote
1
answer
827
views
openssl_decrypt() can't decrypt text encrypted on the commandline
For testing purposes, I wrote encrypt.bash and decrypt.bash, to prove that the encrypted data saved to encrypted.txt can successfully be decrypted.
Here are the bash files:
encrypt.bash
#!/bin/bash
...
1
vote
1
answer
476
views
Encoding problem in C# decrypting in bouncycastle from openssl
I'm trying to decrypt in c#, using bouncycastle, the result of the following php code:
<?php
$plaintext = 'The quick brown fox jumps over the lazy dog';
$cipher = "AES-128-CTR";
...
0
votes
1
answer
107
views
When attempting to decrypt an already encrypted string, no response is given
function encrypt($string, $key)
{
$method = "BF-CBC";
$iv = random_bytes(openssl_cipher_iv_length($method));
$options = 0;
$key = hash("sha256", $key);
return ...
2
votes
2
answers
4k
views
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 ...
36
votes
5
answers
173k
views
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 ...
1
vote
1
answer
3k
views
Decrypt AES-256-CBC using openssl_decrypt in PHP from Subtle Crypto Javascript Payload
I'm trying to encrypt something in JS using webcrypto/window.crypto to AES-256-CBC and trying to decrypt it using PHP's openssl_decrypt function.
My problem is that the decyrption function simply ...
0
votes
1
answer
1k
views
How to decrypt PHP AES-256-ecb encrypted data using linux openssl?
I want to decrypt an AES encrypted json file using Linux pre-installed openssl command line tool, but I cannot figure out how to setup the correct flag of the openssl of Linux. The encryption code is ...
1
vote
1
answer
3k
views
Encrypt using 3DES and PHP's openssl_encrypt()
I'm trying to implement 3DES in PHP (v7.4.6) using openssl_encrypt() but am having problems generating the correct ciphertext output. (I am aware that 3DES is insecure, but I must use it because the ...
0
votes
0
answers
196
views
Email Sending Issue with CodeIgniter on nginx server
I have shifted my client management system to a new server but after that, emails notifications are not working anymore. The new server is running nginx and this is the error I'm getting in the logs. ...
1
vote
2
answers
3k
views
Openssl aes-256-cbc encryption from command prompt and decryption in PHP (and vice versa)
I am trying to encrypt (openssl aes-256-cbc) a string through Windows command prompt and decrypt the result in PHP.
I have done the encryption through:
echo {un:[email protected],upass:klkKJS*dfd!j@d76w} | ...