R
R
reddyk2018-11-09 21:44:14
PHP
reddyk, 2018-11-09 21:44:14

How to decode aes128gcm?

Hello!
How can I decode a request from a web push notification if authToken and publicKey are known.

$ciphertext = .....; // тело запроса
$publicKey = 'BCR.....'; // он же p256dh Key
$authToken ='J4E5H.......';
echo openssl_decrypt($ciphertext, "aes-128-gcm",$publicKey, 0, $authToken);

https://jrconlin.github.io/WebPushDataTestPage/
Here the encoding process is described in more detail, but unfortunately nothing works)
This code unfortunately does not produce anything .... maybe someone came across?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2018-11-09
@inoise

The first question is why did you decide that you need a public key if this is asymmetric encryption

C
CityCat4, 2018-11-10
@CityCat4

No way.
Knowing the public key will not help you - it is public because it is distributed to everyone and without restrictions. You either need a private key, or a brute, or be a math genius...
And first, read about asymmetric encryption...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question