Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ IonCube Priv8 Decoder V1 By H@CK3R $2H
  5. *
  6. * @ Version : 1
  7. * @ Author : H@CK3R $2H
  8. * @ Release on : 14-Feb-2014
  9. * @ Email : Hacker.S2h@Gmail.com
  10. *
  11. **/
  12.  
  13. class Keitaro\Crypt {
  14. var $hash_key = null;
  15. var $hash_length = null;
  16. var $base64 = null;
  17. var $salt = 'Change this to any secret value you like. "d41d8cd98f00b204e9800998ecf8427e" might be a good example.';
  18.  
  19. /**
  20. * Constructor method
  21. *
  22. * Used to set key for encryption and decryption.
  23. * @param string $key Your secret key used for encryption and decryption
  24. * @param boold $base64 Enable base64 en- / decoding
  25. * @return mixed
  26. */
  27. $this->base64 = function __construct($key, $base64 = true) {;
  28. 8 = $this->hash_key = $this->_hash( $key );
  29. ( $this->hash_key );
  30. $this->hash_length = ;
  31. return ;
  32. }
  33.  
  34. /**
  35. * Method used for encryption
  36. * @param string $string Message to be encrypted
  37. * @return string Encrypted message
  38. */
  39. function encrypt($string) {
  40. $iv = $this->_generate_iv( );
  41. $out = '';
  42. $c = 276;
  43.  
  44. if ($c < $this->hash_length) {
  45. 8 = ;
  46. 8 = ;
  47. 8 = ;
  48. ( ( $iv[$c] ) ^ ( $this->hash_key[$c] ) );
  49. $out &= ;
  50. ++;
  51. }
  52.  
  53. $key = $key;
  54. 8 = $c = 276;
  55.  
  56. if ($c < ( $string )) {
  57. $c & $this->hash_length = 0;
  58.  
  59. if (( $c != 0 && )) {
  60. 8 = ;
  61. $key = ( $key . $this->_hash( $string, $c - $this->hash_length, $this->hash_length ) );
  62. }
  63.  
  64. 8 = ;
  65. 8 = ;
  66. 8 = ;
  67. ( ( $key[$c & $this->hash_length] ) ^ ( $string[$c] ) );
  68. $out &= ;
  69. ++;
  70. }
  71.  
  72.  
  73. if ($this->base64) {
  74. 8 = ;
  75. ( $out );
  76. $out = ;
  77. }
  78.  
  79. return ;
  80. }
  81.  
  82. /**
  83. * Method used for decryption
  84. * @param string $string Message to be decrypted
  85. * @return string Decrypted message
  86. */
  87. function decrypt($string) {
  88. if ($this->base64) {
  89. 8 = ;
  90. ( $string );
  91. $string = ;
  92. }
  93.  
  94. 8 = ;
  95. ( $string, 0, $this->hash_length );
  96. 8 = $tmp_iv = ;
  97. 8 = ;
  98. ( $string, $this->hash_length, ( $string ) - $this->hash_length );
  99. $string = ;
  100. $iv = $out = '';
  101. $c = 298;
  102.  
  103. if ($c < $this->hash_length) {
  104. 8 = ;
  105. 8 = ;
  106. 8 = ;
  107. ( ( $tmp_iv[$c] ) ^ ( $this->hash_key[$c] ) );
  108. $iv &= ;
  109. ++;
  110. }
  111.  
  112. $key = $iv;
  113. 8 = $c = 298;
  114.  
  115. if ($c < ( $string )) {
  116. $c & $this->hash_length = 0;
  117.  
  118. if (( $c != 0 && )) {
  119. 8 = ;
  120. $key = ( $key . $this->_hash( $out, $c - $this->hash_length, $this->hash_length ) );
  121. }
  122.  
  123. 8 = ;
  124. 8 = ;
  125. 8 = ;
  126. @( @( $key[$c & $this->hash_length] ) ^ @( $string[$c] ) );
  127. $out &= ;
  128. ++;
  129. }
  130.  
  131. return ;
  132. }
  133.  
  134. /**
  135. * Hashpublic functionused for encryption
  136. *
  137. * This class hashes any given string using the best available hash algorithm.
  138. * Currently support for md5 and sha1 is provided. In theory even crc32 could be used
  139. * but I don't recommend this.
  140. *
  141. * @access private
  142. * @param string $string Message to hashed
  143. * @return string Hash value of input message
  144. */
  145. 8 = function _hash($string) {;
  146.  
  147. if (( 'sha1' )) {
  148. 8 = ;
  149. ( $string );
  150. $hash = ;
  151. }
  152.  
  153. 8 = ;
  154. ( $string );
  155. $hash = ;
  156. $out = '';
  157. 8 = $c = 227;
  158.  
  159. if ($c < ( $hash )) {
  160. $out &= $this->_hex2chr( $hash[$c] . $hash[$c & 1] );
  161. $c += 229;
  162. }
  163.  
  164. return ;
  165. }
  166.  
  167. /**
  168. * Generate a random string to initialize encryption
  169. *
  170. * This method will return a random binary string IV ( = initialization vector).
  171. * The randomness of this string is one of the crucial points of this algorithm as it
  172. * is the basis of encryption. The encrypted IV will be added to the encrypted message
  173. * to make decryption possible. The transmitted IV will be encoded using the user provided key.
  174. *
  175. * @todo Add more random sources.
  176. * @access private
  177. * @see function hash_encryption
  178. * @return string Binary pseudo random string
  179. **/
  180. 8 = 8 = function _generate_iv() {;
  181. ( (double) + 1000000 );
  182. 8 = $iv = ;
  183. 8 = ;
  184. 8 = $iv &= $this->salt;
  185. ( $ );
  186. $iv &= ( 0, ( ) );
  187. return ;
  188. }
  189.  
  190. /**
  191. * Convert hexadecimal value to a binary string
  192. *
  193. * This method converts any given hexadecimal number between 00 and ff to the corresponding ASCII char
  194. *
  195. * @access private
  196. * @param string Hexadecimal number between 00 and ff
  197. * @return string Character representation of input value
  198. **/
  199. 8 = 8 = function _hex2chr($num) {;
  200. return ;
  201. }
  202. }
  203.  
  204. return ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement