Home >Backend Development >PHP Tutorial >PHP custom encryption and decryption program example_PHP tutorial
This article mainly introduces PHP custom encryption and decryption program. The example analyzes the custom encryption and decryption class files and related usage. It has certain reference value, friends in need can refer to it
The example in this article describes the PHP custom encryption and decryption program. Share it with everyone for your reference. The specific analysis is as follows:
PHP3 Cryption is a very easily cracked, insecure encryption feature that should not be used for anything very important. Although encryption is good, it will not hinder the rigorous testing of cutting-edge cracking programs.
Give it a try though... it's a great way to encrypt and decrypt strings. As with many crypt functions, this goes both ways. Based on a password, you can encrypt or decrypt. You can also decrypt or encrypt over an unlimited number of times, through looping or other methods. The characters in the alphabet also change. All these things allow you to modify and solidify encryption.
The best part about this? You can encrypt with decryption or a piece of paper and a pencil. This takes quite a bit longer, but you don't need a computer to be nearby to use it, and if you ever lose the code you can decrypt it if you remember the technique.
I wrote these functions in about an hour, after several unsuccessful and frustrating attempts, and for much longer I had no way out. The best way to do it after a successful day is to suddenly realize it.
Please note that this will not encrypt/decrypt invisible characters (spaces) such as newlines (n) or tabs (t)! Sorry, but I try, if you find a way, please let me know!
The code is as follows:
"; | " . substr($ralphabet,$j,1) . " | n";
" . ($i 1) . "| | ";" . substr($pos_alpha_ary[$i],$k,1) . " | n";
代码如下:
希望本文所述对大家的php程序设计有所帮助。