Answer the question
In order to leave comments, you need to log in
How to make text encryption in php?
Suppose there is a text that needs to be encrypted with the possibility of decryption only with the same key that it was encrypted with.
How to do the following
$key = "9c1b55d563cd6058562b585a1dd976171196002727793a0a5f3867d2afe362dc";
$text = "Текст, который надо зашифровать";
echo mycript($text, $key); // Выведит какой то непонятный набор символов
$save = mycript($text, $key);
echo myencript($save, $key); // Выведит "Текст, который надо зашифровать"
Answer the question
In order to leave comments, you need to log in
The main question is WHY?
Practice? Open information on existing *encryption* algorithms and try to implement them in PHP.
Data protection? You also look for information about existing algorithms and choose the appropriate one. Then google: "{algorithm name} in PHP".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question