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

https://www.google.com/search?q=php+aes-128+php&oq=php+aes-128+php&aqs=chrome..69i57j0i19l2j69i60l2.13411j0j7&client=ms-android-motorola-rev2&sourceid=chrome-mobile&ie=UTF-8

Google :point_up:
:point_down:

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

<?php
$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


<?php
$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

@Yashsehgal022
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

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

works fine for me

why are you using web component ?

@Yashsehgal022
please see this post https://community.kodular.io/t/what-method-is-used-in-aes-128-encryption-cryptography-component/40066/3

we use encryption from php and decription kodular componant

why ? may i know

@Yashsehgal022
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.

:point_down:

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

3 Likes

@Rogerio_Rios

No one can understand what I want help.