Advertisement
G3n3Rall

BHG Text Encryptor - Decryptor

May 19th, 2012
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 2.59 KB | None | 0 0
  1. Hi Guys
  2. with this script you can have hash with your own key
  3. just u choose a key for example "BHG" and then encrypt a text
  4.  
  5. it will get u a hash in Crypted.txt then if you want take it back [ decrypt it]
  6. u just enter your own key and u script will read Crypted.txt and get u
  7. real text
  8.  
  9. if no body dont have your key no body cannot decrypt your text
  10. it's good for when you have important text in your pc :D
  11.  
  12.  
  13.  
  14. #!/usr/bin/perl
  15. #BHG Text Cryptor & Decryptor Version Beta
  16. #You Can Have Your Own Hash Code With Your Own Key :)
  17. #Code By G3n3Rall
  18. #Black Hat Group Security Center
  19. #www.black-hg.org   ||| www.black-hg.org/cc/
  20. #We Are : Net.Edit0r , A.Crox , 3H34N
  21. #Am!n , tHe.K!ll3r ArYaIeIrAn , G3n3Rall
  22. #Mr.XHat , NoL1m1t , Dj.TiniVini , 4ut0n0m0us ...
  23.  
  24. system(($^O eq 'MSWin32') ? 'cls' : 'clear');
  25. print "\n\t\t www.Black-hg.org\n\n";
  26. print "\n\n\t\t Welcome To BHG Encryptor - Decryptor\n";
  27. print "\n\n\t\tPlease Enter a Key:";
  28. $GetKey=<STDIN>;
  29. chomp($GetKey);
  30. my $key = "$GetKey";
  31. Menu:;
  32. print "\n\n\n\t\t What Do you want to do ?";
  33. print "\n\t\t 1- Encrypt";
  34. print "\n\t\t 2-Decrypt";
  35. print "\n\t\tChoose:";
  36. $Menu=<STDIN>;
  37. chomp ($Menu);
  38. if ($Menu==1){
  39. system(($^O eq 'MSWin32') ? 'cls' : 'clear');
  40. print "\n\n\t\t\t Please Enter Your Text \n";
  41. print"Text:";
  42. $TEXT=<STDIN>;
  43. chomp($TEXT);
  44. print "\n";
  45. my $str = $TEXT;
  46. my $encoded = xor_encode($str,$key);
  47. system(($^O eq 'MSWin32') ? 'cls' : 'clear');
  48. print "\n\n\t\t Your Code Saved to Crypted.txt\n\n\n";
  49. open (TEXT, '>>Crypted.txt');
  50. print TEXT "$encoded";
  51. close (TEXT);
  52. print "\nwww.Black-hg.org  || Code by G3n3Rall";
  53. print "Exit\n";
  54. exit;
  55. }
  56. if($Menu==2){
  57. system(($^O eq 'MSWin32') ? 'cls' : 'clear');
  58. print "Please Wait ... ";
  59. print "\n";
  60. print "\n\n\t\t Opening Crypted.txt \n";
  61. open (Decrypt, "<Crypted.txt") or die "\n\tSry NOT FOUND Crypted.txt \n";
  62. while (<Decrypt>){
  63. my $encoded = $_;
  64. my $decoded = xor_encode($encoded,$key);
  65. system(($^O eq 'MSWin32') ? 'cls' : 'clear');
  66. print "\n\n\t\t Decoded ! \n\n";
  67. print "\nYour Text:\n";
  68. print "$decoded";
  69.  
  70. print "\n\n\n";
  71. print "\nwww.Black-hg.org  || Code by G3n3Rall";
  72. print "Exit\n";
  73. exit;
  74. }
  75. }
  76.  
  77. sub xor_encode {
  78.    my ($str, $key) = @_;
  79.    my $enc_str = '';
  80.    for my $char (split //, $str){
  81.        my $decode = chop $key;
  82.        $enc_str .= chr(ord($char) ^ ord($decode));
  83.        $key = $decode . $key;
  84.    }
  85.   return $enc_str;
  86. }
  87.  
  88. if ($Menu=! 1 || 2) {
  89.  
  90. print "\n\n\t\t INVALID ID\n ";
  91. goto Menu;
  92. }
  93.  
  94.  
  95.  
  96.  
  97. Black Hat group Security Center
  98. Site: www.Black-hg.org
  99. Forum: www.Black-hg.org/cc/
  100. By G3n3Rall
  101. AnTi.SecurityBoy@Gmail.com
  102.  
  103. Bye.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement