#!/usr/bin/perl # # XOR FILE Encryption/Decryption # # Copyright 2018 (c) Todor Donev # https://ethical-hacker.org/ # https://facebook.com/ethicalhackerorg # # Disclaimer: # This or previous programs is for Educational # purpose ONLY. Do not use it without permission. # The usual disclaimer applies, especially the # fact that Todor Donev is not liable for any # damages caused by direct or indirect use of the # information or functionality provided by these # programs. The author or any Internet provider # bears NO responsibility for content or misuse # of these programs or any derivatives thereof. # By using these programs you accept the fact # that any damage (dataloss, system crash, # system compromise, etc.) caused by the use # of these programs is not Todor Donev's # responsibility. # # Use them at your own risk! # use warnings; use strict; print "[ XOR FILE Encryption/Decryption\n"; print "[ ======\n"; print "[ Author: Todor Donev \n"; print "[ https://ethical-hacker.org/\n"; print "[ https://fb.com/ethicalhackerorg\n"; print "[ ======\n"; die "[ Usage: $0 \n" if(@ARGV != 3); my $key = chr(hex($ARGV[0])); print "[ Opening $ARGV[1]\n"; open(IN, "<$ARGV[1]") or die "[ Error: Can't read $ARGV[1]: $!\n"; print "[ Error: $ARGV[1] is empty file\n" and exit if (-z $ARGV[1]); open(OUT, ">$ARGV[2]") or die "[ Error: Can't wrote $ARGV[2]: $!\n"; binmode(IN); binmode(OUT); print "[ Calculation..\n"; while( sysread(IN,my $in,length($key))) { print OUT $in^substr($key,0,length($in)); } print "[ Ready and $ARGV[2] file is closed.\n"; close(IN); close(OUT);