How to work aes 128 cryptography with php

Continuing the discussion from What method is used in AES-128 encryption (Cryptography component):

i want to php file please help me.
i want to see how to work this

Google :point_up:

1 Like

can you give some example with kodular block ?

I am not sure but is this what you are looking for

see this also

maybe something from these can help

1 Like

we encrypt success but kodular not decrypt data.
how to decrypt data in app ?

@Mukesh_Rajput try this

for encrypt string use this code

$simple_string = $_GET['string'];
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$encryption_iv = '1234567891011121';
$encryption_key = "yourkey";
$encryption = openssl_encrypt($simple_string, $ciphering,
			$encryption_key, $options, $encryption_iv);
echo $encryption;

and for decrypt string use this code

$ciphering = "AES-128-CTR";
$options = 0;
$simple_string = $_GET['string'];
$decryption_iv = '1234567891011121';
$decryption_key = "yourkey";
$decryption=openssl_decrypt ($simple_string, $ciphering,
		$decryption_key, $options, $decryption_iv);
echo $decryption;

I just modified the code provided by geeksforgeeks

you can host two websites one for encryption and the second for decryption

code working perfectly but kodular not decrypt

your question(in the main post) is totally different from what you are doing , you were asking for PHP file in the main post and now as I can see the doubt is related to cryptography component

1 Like

We use both
but how to decrypt data use cryptography componant ?

works fine for me

why are you using web component ?

please see this post

we use encryption from php and decription kodular componant

why ? may i know

we send encrypted data to my server than decrypt data using php script

1 Like

sorry I dont know how to do that , maybe someone else can help you

Friend, the posts above have your solution.


Next step :
-read about web Component
-understand the php blocks and adapt them to your needs
-Check what didn’t work…



No one can understand what I want help.