DEV Community

Dhruv Sharma
Dhruv Sharma

Posted on

Is this exact encryption possible with any react library?

$cnum =trim($_POST['cnum']);
$ciphering = "AES-128-CTR";
$iv_length = openssl_cipher_iv_length($ciphering);
$options = 0;
$encryption_iv = '1234467892211121';
$encryption_key = "SECRET";
$en = openssl_encrypt($cnum, $ciphering, $encryption_key, $options, $encryption_iv);
can i do same encryption with javascript

Top comments (2)

Collapse
 
okrohan profile image
Rohan Salunke

React has nothing to do with encryption! You could try CryptoJS AES cipher with CTR mode
cryptojs.gitbook.io/docs/#ciphers

Collapse
 
dhruvsharma001 profile image
Dhruv Sharma • Edited

I know what I meant was with js or any encrypting library .. this isn't possible with cryptojs I tried but this exact encryption is not possible ..