Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env perl
- use warnings;
- use strict;
- use utf8;
- use feature qw<say>;
- use List::Util qw<any>;
- my @chars = map{ord} (0..9,'a'..'z','A'..'Z');
- my @firstKey;
- my @secondKey;
- my $counter = 1;
- for my $i (@chars) {
- for my $j (@chars) {
- my $i_ans = ($i ^ 0x16);
- my $j_ans = ($j ^ 0x0f);
- my $i_t = any{$_ == $i_ans} @chars;
- my $j_t = any{$_ == $j_ans} @chars;
- if (($i_ans == $j_ans) && $i_t && $j_t) {
- push @firstKey
- => sprintf "(%d)->First Key: [%s] %s %s", $counter, chr($i_ans), chr($i), chr($j);
- $counter++;
- }
- }
- }
- $counter = 1;
- for my $i (@chars) {
- for my $j (@chars) {
- my $i_ans = ($i ^ 0x1a);
- my $j_ans = ($j ^ 0x02);
- my $i_t = any{$_ == $i_ans} @chars;
- my $j_t = any{$_ == $j_ans} @chars;
- if (($i_ans == $j_ans) && $i_t && $j_t) {
- push @secondKey
- => sprintf "(%d)->Second Key: [%s] %s %s", $counter, chr($i_ans), chr($i), chr($j);
- $counter++;
- }
- }
- }
- for my $f (@firstKey) {
- say "|------------------------------------------------------------------|";
- say $f;
- for my $s (@secondKey) {
- say "\t\t\t$s";
- }
- say "|------------------------------------------------------------------|";
- }
- exit (0);
- #0x16 0x1a 0x10 0x6c 0x0f 0x02
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement