Advertisement
kaitolegion

Encode Decode

Dec 6th, 2019
997
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. <?php
  2. echo "
  3. <html>
  4. <head>
  5. <title>Encode Decode - Kaito Legion</title>
  6. </head>
  7. <style>
  8. body {
  9. text-align:center;
  10. }
  11. h1 {
  12. font-family: courier new;
  13. }
  14. textarea {
  15. width:390px;
  16. height:100px;
  17. }
  18. </style>
  19. <body>
  20. <h1>Encode - Decode</h1>
  21.  
  22. <form method=\"POST\">
  23. <textarea name=\"code\">
  24. </textarea>
  25. <br>
  26. <select name='ende'>
  27. <option value=\"urlencode\">Select</option>
  28. <option value=\"base64\">Base64</option>
  29. <option value=\"base64convert\">base64 - convert_uu</option>
  30. <option value=\"gzinflates\">gzinflate - base64</option>
  31. <option value=\"str2\">str_rot13 - base64</option>
  32. <option value=\"gzinflate\">str_rot13 - gzinflate - base64</option>
  33. <option value=\"str\">str_rot13 - gzinflate - str_rot13 - base64</option>
  34. <option value=\"url\">base64 - gzinflate - str_rot13 - convert_uu - gzinflate - base64</option>
  35. </select>
  36. <br>
  37. <input type='submit' name='encode' value='Encode'>
  38. <input type='submit' name='decode' value='Decode'>
  39. <br>
  40. ";
  41.  
  42. @ini_set('output_buffering',0);
  43. @ini_set('display_errors', 0);
  44. $text = $_POST['code'];
  45. $encode = $_POST['encode'];
  46. if (isset($encode)) {
  47. $ende = $_POST['ende'];
  48.  
  49. switch ($ende) {
  50. case 'urlencode':
  51. $kai = rawurlencode($text);
  52. break;
  53. case 'base64':
  54. $kai = base64_encode($text);
  55. $kai = "<?php eval('?>'.base64_decode('$kai'));";
  56. break;
  57. case 'base64convert':
  58. $kai = base64_encode(convert_uuencode($text));
  59. break;
  60. case 'gzinflates':
  61. $kai = base64_encode(gzdeflate($text));
  62. break;
  63. case 'str2':
  64. $kai = base64_encode(str_rot13($text));
  65. break;
  66. case 'gzinflate':
  67. $kai = base64_encode(gzdeflate(str_rot13($text)));
  68. break;
  69. case 'str':
  70. $kai = base64_encode(str_rot13(gzdeflate(str_rot13($text))));
  71. break;
  72. case 'url':
  73. $kai = base64_encode(gzdeflate(convert_uuencode(str_rot13(gzdeflate(base64_encode($text))))));
  74. break;
  75.  
  76. default:
  77. # code...
  78. break;
  79. }
  80. }
  81.  
  82. $decode = $_POST['decode'];
  83. if (isset($decode)) {
  84. $ende = $_POST['ende'];
  85. switch ($ende) {
  86. case 'urlencode':
  87. $kai = rawurldecode($text);
  88. break;
  89. case 'base64':
  90. $kai = base64_decode($text);
  91. break;
  92. case 'base64convert':
  93. $kai = convert_uudecode(base64_decode($text));
  94. break;
  95. case 'gzinflates':
  96. $kai = gzinflate(base64_decode($text));
  97. break;
  98. case 'str2':
  99. $kai = str_rot13(base64_decode($text));
  100. break;
  101. case 'gzinflate':
  102. $kai = str_rot13(gzinflate(base64_decode($text)));
  103. break;
  104. case 'str':
  105. $kai = str_rot13(gzinflate(str_rot13(base64_decode(($text)))));
  106. break;
  107. case 'url':
  108. $kai = base64_decode(gzinflate(str_rot13(convert_uudecode(gzinflate(base64_decode(($text)))))));
  109. break;
  110. default:
  111. # code...
  112. break;
  113.  
  114.  
  115. }
  116. }
  117.  
  118. echo "
  119.  
  120. <textarea>
  121. $kai
  122. </textarea>
  123.  
  124.  
  125. </form>
  126. </body>
  127. </html>
  128.  
  129. ";
  130.  
  131.  
  132. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement