A
A
Artyom Sysolyatin2015-12-20 12:21:19
PHP
Artyom Sysolyatin, 2015-12-20 12:21:19

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); // Выведит "Текст, который надо зашифровать"

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
v- death, 2015-12-20
@pingvi69

https://github.com/jungepiraten/nntpboard/blob/mas...

D
D', 2015-12-20
@Denormalization

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 question

Ask a Question

731 491 924 answers to any question