Advertisement
Guest User

Untitled

a guest
Oct 4th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Notice: Uninitialized string offset: 63 in [...][...] on line 18
  2. Notice: Uninitialized string offset: 63 in [...][...] on line 19
  3.  
  4. $tmp = md5(md5($key.$strofsym[$x-1]).$key);
  5. $encoded = str_replace($tmp[3].$tmp[6].$tmp[1].$tmp[2], $strofsym[$x-1], $encoded);
  6.  
  7. function encode($unencoded,$key){ //Шифрование
  8. $string=base64_encode($unencoded);
  9. $newstr = '';
  10. $arr=array();
  11. $x=0;
  12. while ($x++< strlen($string)) {
  13. $arr[$x-1] = md5(md5($key.$string[$x-1]).$key);
  14. $newstr = $newstr.$arr[$x-1][3].$arr[$x-1][6].$arr[$x-1][1].$arr[$x-1][2];
  15. }
  16. return $newstr;
  17. }
  18.  
  19. function decode($encoded, $key){ //Расшифровка
  20. $strofsym='qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM=';
  21. $x=0;
  22. while ($x++<= strlen($strofsym)) {
  23. $tmp = md5(md5($key.$strofsym[$x-1]).$key);
  24. $encoded = str_replace($tmp[3].$tmp[6].$tmp[1].$tmp[2], $strofsym[$x-1], $encoded);
  25. }
  26. return base64_decode($encoded);
  27. }
  28.  
  29. echo decode('70072bbbd45b597a700751f437683768','z');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement