求一解密函数的对应加密函数
程序员文章站
2022-06-02 21:26:42
...
现在已知一解密函数(readkey)如下,求对应的加密函数
function authcode( $string, $operation = "DECODE", $key = "", $expiry = 0 ){ $ckey_length = 4; $key = md5( $key != "" ? $key : "a2264dxLupVMlkqR" ); $keya = md5( substr( $key, 0, 16 ) ); $keyb = md5( substr( $key, 16, 16 ) ); $keyc = $ckey_length ? $operation == "DECODE" ? substr( $string, 0, $ckey_length ) : substr( md5( microtime( ) ), 0 - $ckey_length ) : ""; $cryptkey = $keya.md5( $keya.$keyc ); $key_length = strlen( $cryptkey ); $string = $operation == "DECODE" ? base64_decode( substr( $string, $ckey_length ) ) : sprintf( "%010d", $expiry ? $expiry + time( ) : 0 ).substr( md5( $string.$keyb ), 0, 16 ).$string; $string_length = strlen( $string ); $result = ""; $box = range( 0, 255 ); $rndkey = array( ); $i = 0; for ( ; $i
加密后的字串: 正确的在2楼561eqDNvqSI/n6UPGqb5XbORsuT9a26W6M415bRUYpP4enT5Kb/BLd5MI7Jvvt2RE35r1lHrdtC5MYNUtP7gpbqY0GeUbLXRUrUL9ABC1XTFD4zlVf3VoM4HUdEUxHAkVivkA2G1ywT2VXlLNrnuq9AXs65GXrD0G2ILS693cfGAwn4xL4QI313FVYtHWLK/EIcg0HyRMxMR5P8fftAA+Fw42c5c31G8yCh96lNfBcrhsjuO7tqJuiBSuKQBH3bbxfnum1yb1RgI8myw23tlrtdDBoPiNpCgm1usa2L+lAXLhvE8yqRLg5T8ZVXxwvO1quV8zMpBrY/XxRu5+Nn6AvXsKUwdyhVCp2jgj5S4Yr0CWcyiUg
回复讨论(解决方案)
但你的函数并不能还原你的加密串
但你的函数并不能还原你的加密串
不好意思。给错了,这段字符串5463Y5sPLQyvMtPQhkngTjLDP0soLvmhapvAYaha3XflhpkhpVP059ow7wZ9b+TGkcVoKNM38P9TQJ4OrOQnn+xq5csI/5xB7t+x1T3W9CkKN+ocjNKQyI0yyyL4SUakFwqAJjebUICbw9JvRlidbi6awuU8PKnyR4hSOL3376WA24SjqpxGmvJ0S76+76eJt5e3CeL2PdklXdxoFWz1Nc5ZQLW0a0xpvabsBqSGAWXIhFmoa9wkP8pZHz8cDofPZjhA7GoIcCg6XWRg978Jkq3uMxT7Z5zTyY9VgW4BHvQbQZp242IDaafgGt1gVIu4rwarcCARDu+xLo74jHeJ2ZsCXHq/HvsqnQywsz8nWOwrYdZGjhlz5nExdSY7PXpicxR2q/E
我没权限改主题了。麻烦帮修改一下。已自己搞定。。
楼主,能否分享一下对于移位的解密思路呢?