0
Want to store in a text file, at the root of my application, a key generated by PHP, as a salt.
That key would help encrypt passwords, database access information. That is, such information would be encrypted to be used by PHP.
Se necessite de acesso o banco de dados através do javascript, usaria este salt para descriptografar as informações e effecto o acesso, lendo diretamente do arquivo de texto.
My doubt
Is it possible that some value encrypted in PHP can be decrypted in javascript and vice versa? How can it be done, and which algorithm to use?
Is there any standard to traffic information between the two languages (PHP and javascript)?
It is to run in a browser, IE, is a website? Because the javascript that is accessed by the client in the browser can be read without restriction, ie without security.
– celsomtrindade
Yes. Exactly that. My idea was to do this in a safe way.
– robertaodj
The question doesn’t seem to define a goal, in fact little of it makes any sense. TLS/SSL already does exactly what it’s asking. TLS uses a temporary key (or not, in some Cipher old suite) for each connection (using DH, DHE, ECDHE or X25519), encrypt the data using the key and then the server decrypts the data with such a key. That is, the client sends encrypted data to the server.
– Inkeliz