L
L
Lomoson2013-12-20 01:52:53
PHP
Lomoson, 2013-12-20 01:52:53

How to encrypt data in php?

The user specifies a phrase and a private key. You need to encrypt the data and decrypt it using the entered key.
I looked in the direction of RSA, but either I'm stupid, or I can't figure out how to approach. I looked at the library at phpseclib.sourceforge.net/rsa/examples.html , but nothing good came of it.
Please tell me how to solve this problem.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
maxaon, 2013-12-20
@Lomoson

https://www.google.com
www.php.net/manual/en/book.openssl.php
phpseclib.sourceforge.net/rsa/intro.html

A
Alexey, 2013-12-20
@ScorpLeX

Well, for example:
Connect extension=php_openssl.dll
to PHP Encrypt openssl_encrypt ('text' , 'AES-256-CBC' , 'user_password') and use
openssl-decrypt to decrypt it.

S
svd71, 2013-12-20
@svd71

Why doesn't standard https suit you? All traffic is already encrypted.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question