Advertisement
Guest User

Untitled

a guest
Mar 8th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.3.0
  8. * @ Author : DeZender
  9. * @ Release on : 17.05.2011
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function genPrivateKey() {
  15. $entropy = shell_exec( 'head -c ' . mt_rand( 3000, 4000 ) . ' < /dev/urandom' );
  16. $salt = mktime( );
  17. $privateKey = sha1( sha1( $salt . $entropy ) . $salt );
  18. return $privateKey;
  19. }
  20.  
  21. function genPublicKey($text) {
  22. $salt = mktime( );
  23. $rand = mt_rand( );
  24. $publicKey = md5( $rand . $text . $salt );
  25. return $publicKey;
  26. }
  27.  
  28. function encrypt($text, &$privateKey) {
  29. $publicKey = genPublicKey( $text );
  30. $shiftKey = sha1( $privateKey . '+' . $publicKey );
  31. $text_array = str_split( $text );
  32. $shift_array = str_split( $shiftKey );
  33. $counter = 0;
  34. $i = 0;
  35.  
  36. while ($i < sizeof( $text_array )) {
  37. if (40 < $counter) {
  38. $counter = 0;
  39. }
  40.  
  41. $cryptChar = ord( $text_array[$i] ) + ord( $shift_array[$counter] );
  42. $cryptChar -= floor( $cryptChar / 127 ) * 127;
  43. $cipherStream[$i] = dechex( $cryptChar );
  44. ++$counter;
  45. ++$i;
  46. }
  47.  
  48. $cipher = implode( ':', $cipherStream ) . '/' . $publicKey;
  49. return $cipher;
  50. }
  51. ..............................
  52. .............
  53. .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement