Hey guys,
Just wondering if this would be enough so that some script kiddie/or maybe advanced hacker can't decrypt this. Looking to do some massive encryption for a user system I am creating. Is this enough? And when I mean enough, I mean so that hackers will take one look and say not worth it - meaning it will be very hard/impossible to decrypt without the pass key.
I'm no good with encryption and decryption when it comes to php, I know very little in this area of php, everything else I am fine at. Is this really enough?
The above script works fine, but for some reason it shows question marks after the decrypted data. Not sure if I'm doing something wrong, but I guess I can discard those unless the user has his/her password ending with a question mark. If anyone knows another way that's better than this, let me know.
Any inputs are appreciated :tu:
Just wondering if this would be enough so that some script kiddie/or maybe advanced hacker can't decrypt this. Looking to do some massive encryption for a user system I am creating. Is this enough? And when I mean enough, I mean so that hackers will take one look and say not worth it - meaning it will be very hard/impossible to decrypt without the pass key.
PHP:
<?php
$key = "some pass code";
$input = "the text needing encryption";
$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
echo "$encrypted_data";
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
// now to decrypt it here (will use same pass key above, but the admin section will request the pass key before showing the decrypted data)
$td2 = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv2 = mcrypt_create_iv (mcrypt_enc_get_iv_size($td2), MCRYPT_RAND);
mcrypt_generic_init($td2, $key, $iv2);
$encrypted_data2 = mdecrypt_generic($td2, $encrypted_data);
echo "<br><br>Decrypted Data: $encrypted_data2";
mcrypt_generic_deinit($td2);
mcrypt_module_close($td2);
?>
I'm no good with encryption and decryption when it comes to php, I know very little in this area of php, everything else I am fine at. Is this really enough?
The above script works fine, but for some reason it shows question marks after the decrypted data. Not sure if I'm doing something wrong, but I guess I can discard those unless the user has his/her password ending with a question mark. If anyone knows another way that's better than this, let me know.
Any inputs are appreciated :tu:






