Jump to content

Destramic

Members
  • Content Count

    954
  • Joined

  • Last visited

Everything posted by Destramic

  1. although looking further into your script i would leave the encryption of passwords to server side (behind closed doors) your want to be using http://php.net/manual/en/function.password-verify.php and http://php.net/manual/en/function.password-hash.php on your passwords and possibly encrypt the password using aes also before-hand
  2. the reason your form isn't working is because of your formhash js function if you open console in your browser you will see it says which point to this line here: p.value = hex_sha512(password.value); once you sort out you js error the form should submit as intended by your js function
  3. sorry for the delay but i haven't been about to reply....but thank you for the great information and helping me to understand aes a lot more than i did, it's greatly appreciated...i'll take on board your advice and sort my coding out, once done i'll post my code for others to see and learn cheers jacques
  4. ok will you help i reviewed the way i was doing things as i wanted to use PKCS#7 instead of OPENSSL_RAW_DATA as i read it is the best method? here is my working (i still have to tidy up a few things with it though) code which is compatible js - php and visa versa...hopefully it can help someone else out who is trying to learn aes and how to encrypt thier data the right way. js version aes.js var crypto = require('crypto'); $encryption_algorithm = 'AES-128-CBC'; $bytes = 16; $master_key = null; module.exports = { generate_master_key: function (l
  5. ok thank you....but when generating a key from my generate_master_key() in my aes.php i'm able to use any number of bytes i wish? and it encrypts fine the code works perfect also thanks i altered a bit so the init vector returns as hexidecimal after used for encrypting, so it's the same as my php version and then returned back to binary afterwards before decrypting. const CRYPTO = require('crypto'); const CIPHER = "AES-128-CBC"; const MASTER_KEY_HEX = "28c03478bbd1874d5c472dd5d6f00ca0"; const MASTER_KEY = new Buffer(MASTER_KEY_HEX, "hex"); console.log('master
  6. after more help from jacques1 i've been tring to use nodejs's crypto...i want to be able to encryt data via js and decrypt via php and visa versa. in my aes.js i have created function so i can encrypt and decrypt data although i get an error on both and i'm completely stuck! to be honest all this encrypting and decrypting is quite confusing to say the least and could really do with some more help...the iv length is set at 32 which is obviously too shore or too long...where am i going wrong here please? here is all my code that i am using for this test.js var aes =
  7. problem came to the spaces in the directory when executing my batch file here is how i fixed it. @ECHO OFF start "r:\localhost\nginx 1.8.1\nginx.exe" start "r:\localhost\php\7.0.3 nts\php-cgi.exe" -b 192.168.1.168:9000 -c "r:\localhost\php\7.0.3 nts\php.ini" ping 192.168.1.168 -n 1>NUL echo starting nginx echo . echo .. echo ... ping 192.168.1.168 >NUL EXIT
  8. hey guys...i'm having a little bit of trouble installing php on a alternative driver...i'm using windows 10 and have unzipped php 7.0.3 in the folder: R:\localhost\php\7.0.3 nts normally i would install it in c:\php but doing it on a alternative drive i'm having trouble loading the extensions. in the php.ini i have taken out the semi colan on the extensions and added a extension directory like so: extension_dir = "R:/localhost/php/7.0.3 nts/ext/" extension=php_openssl.dll etc... and i aslo put in a system variable under paths ;R:\localhost\php\7.0.3 nts\ then when trying to run
  9. no that's just the example i did when you first tought me i'll install the module over the weeked and have a good go at it...thank you for your help!
  10. hey guys i had some really good help off jacques1 a while back about encrypting/decrypting rows in my database via php...now as i've gone further down the line in my project i have stumbled across a problem i didnt forsee. i'm using nodejs which connects to my database for one of my pages...but the data is encryted...i need to also encrypt and decrypt the database rows server side via javascript this is how it's done via php: <?php const ENCRYPTION_ALGORITHM = 'AES-128-CBC'; class AES { private $_master_key; public function __construct() { $this->_ma
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.