Login Register




The stories and information posted here are artistic works of fiction and falsehood. Only a fool would take anything posted here as fact.


Text Cryptor & Decryptor - Perl filter_list
Author
Message
Text Cryptor & Decryptor - Perl #1
PHP Code:
#!/usr/bin/perl #BHG Text Cryptor & Decryptor Version Beta #You Can Have Your Own Hash Code With Your Own Key :) system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "\n\t\t www.Black-hg.org\n\n"; print "\n\n\t\t Welcome To BHG Encryptor - Decryptor\n"; print "\n\n\t\tPlease Enter a Key:"; $GetKey=<STDIN>; chomp($GetKey); my $key = "$GetKey"; Menu:; print "\n\n\n\t\t What Do you want to do ?"; print "\n\t\t 1- Encrypt"; print "\n\t\t 2-Decrypt"; print "\n\t\tChoose:"; $Menu=<STDIN>; chomp ($Menu); if ($Menu==1){ system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "\n\n\t\t\t Please Enter Your Text \n"; print"Text:"; $TEXT=<STDIN>; chomp($TEXT); print "\n"; my $str = $TEXT; my $encoded = xor_encode($str,$key); system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "\n\n\t\t Your Code Saved to Crypted.txt\n\n\n"; open (TEXT, '>>Crypted.txt'); print TEXT "$encoded"; close (TEXT); print "\nwww.Black-hg.org || Code by G3n3Rall"; print "Exit\n"; exit; } if($Menu==2){ system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "Please Wait ... "; print "\n"; print "\n\n\t\t Opening Crypted.txt \n"; open (Decrypt, "<Crypted.txt") or die "\n\tSry NOT FOUND Crypted.txt \n"; while (<Decrypt>){ my $encoded = $_; my $decoded = xor_encode($encoded,$key); system(($^O eq 'MSWin32') ? 'cls' : 'clear'); print "\n\n\t\t Decoded ! \n\n"; print "\nYour Text:\n"; print "$decoded"; print "\n\n\n"; print "\nwww.Black-hg.org || Code by G3n3Rall"; print "Exit\n"; exit; } } sub xor_encode { my ($str, $key) = @_; my $enc_str = ''; for my $char (split //, $str){ my $decode = chop $key; $enc_str .= chr(ord($char) ^ ord($decode)); $key = $decode . $key; } return $enc_str; } if ($Menu=! 1 || 2) { print "\n\n\t\t INVALID ID\n "; goto Menu; }

Reply