Jump to content
Tuts 4 You

Edit History

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The key was brute forced using a quickly written C++ executable:

image.png.1b2c158f408f5826ad121cdd59a52805.png

 

The code for the C++ executable is as follows:

Spoiler

 


#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
	return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
	double product = additive_key +
		(static_cast<double>(k3) * 0.2254315957569856) +
		(static_cast<double>(k2) * -0.06225786672735933) +
		(static_cast<double>(k1) * 0.06576137583312501) +
		(static_cast<double>(k0) * -0.2174719016579794) +
		0.0;
	
	return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
	for (int a = 0; a < 256; a++) 
	{
		for (int b = 0; b < 256; b++) 
		{
			for (int c = 0; c < 256; c++) 
			{
				for (int d = 0; d < 256; d++)
				{
					if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
					{
						if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
						{
							std::cout << "Found partial key match!" << std::endl
								<< "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
								<< "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
								<< "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
								<< "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
								<< std::endl;

							key[indices[0]] = a;
							key[indices[1]] = b;
							key[indices[2]] = c;
							key[indices[3]] = d;
							return true;
						}
					}
				}
			}
		}
	}

	std::cout << "Could not bruteforce the selected keypart!" << std::endl;
	return false;
}

void printkey(std::array<char, 16> const& key)
{
	std::cout << "Current key:" << std::endl;

	for (char const& ch : key)
	{
		if (ch == 0)
			std::cout << "_";
		else
			std::cout << ch;
	}

	std::cout << std::endl;
	std::cout << std::endl;
}

int main(int argc, char* argv[])
{
	std::array<char, 16> key = { 0 };
	printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
		printkey(key);

	std::cout << "Finished bruteforce!" << std::endl;
	std::cin.ignore();
	std::cin.get();
	return 0;
}

 

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The key was brute forced using quick C++ markup:

image.png.1b2c158f408f5826ad121cdd59a52805.png

 

The following was used to brute force:

Spoiler

 


#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
	return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
	double product = additive_key +
		(static_cast<double>(k3) * 0.2254315957569856) +
		(static_cast<double>(k2) * -0.06225786672735933) +
		(static_cast<double>(k1) * 0.06576137583312501) +
		(static_cast<double>(k0) * -0.2174719016579794) +
		0.0;
	
	return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
	for (int a = 0; a < 256; a++) 
	{
		for (int b = 0; b < 256; b++) 
		{
			for (int c = 0; c < 256; c++) 
			{
				for (int d = 0; d < 256; d++)
				{
					if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
					{
						if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
						{
							std::cout << "Found partial key match!" << std::endl
								<< "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
								<< "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
								<< "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
								<< "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
								<< std::endl;

							key[indices[0]] = a;
							key[indices[1]] = b;
							key[indices[2]] = c;
							key[indices[3]] = d;
							return true;
						}
					}
				}
			}
		}
	}

	std::cout << "Could not bruteforce the selected keypart!" << std::endl;
	return false;
}

void printkey(std::array<char, 16> const& key)
{
	std::cout << "Current key:" << std::endl;

	for (char const& ch : key)
	{
		if (ch == 0)
			std::cout << "_";
		else
			std::cout << ch;
	}

	std::cout << std::endl;
	std::cout << std::endl;
}

int main(int argc, char* argv[])
{
	std::array<char, 16> key = { 0 };
	printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
		printkey(key);

	std::cout << "Finished bruteforce!" << std::endl;
	std::cin.ignore();
	std::cin.get();
	return 0;
}

 

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The key was brute forced using quick C++ markup:

image.png.1b2c158f408f5826ad121cdd59a52805.png

 

The following was used to brute force:

#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
	return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
	double product = additive_key +
		(static_cast<double>(k3) * 0.2254315957569856) +
		(static_cast<double>(k2) * -0.06225786672735933) +
		(static_cast<double>(k1) * 0.06576137583312501) +
		(static_cast<double>(k0) * -0.2174719016579794) +
		0.0;
	
	return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
	for (int a = 0; a < 256; a++) 
	{
		for (int b = 0; b < 256; b++) 
		{
			for (int c = 0; c < 256; c++) 
			{
				for (int d = 0; d < 256; d++)
				{
					if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
					{
						if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
						{
							std::cout << "Found partial key match!" << std::endl
								<< "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
								<< "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
								<< "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
								<< "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
								<< std::endl;

							key[indices[0]] = a;
							key[indices[1]] = b;
							key[indices[2]] = c;
							key[indices[3]] = d;
							return true;
						}
					}
				}
			}
		}
	}

	std::cout << "Could not bruteforce the selected keypart!" << std::endl;
	return false;
}

void printkey(std::array<char, 16> const& key)
{
	std::cout << "Current key:" << std::endl;

	for (char const& ch : key)
	{
		if (ch == 0)
			std::cout << "_";
		else
			std::cout << ch;
	}

	std::cout << std::endl;
	std::cout << std::endl;
}

int main(int argc, char* argv[])
{
	std::array<char, 16> key = { 0 };
	printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
		printkey(key);

	std::cout << "Finished bruteforce!" << std::endl;
	std::cin.ignore();
	std::cin.get();
	return 0;
}

 

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The key was brute forced using quick C++ markup:

image.png.1b2c158f408f5826ad121cdd59a52805.png

 

The following was used to brute force:

#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
	return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
	double product = additive_key +
		(static_cast<double>(k3) * 0.2254315957569856) +
		(static_cast<double>(k2) * -0.06225786672735933) +
		(static_cast<double>(k1) * 0.06576137583312501) +
		(static_cast<double>(k0) * -0.2174719016579794) +
		0.0;
	
	return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
	for (int a = 0; a < 256; a++) 
	{
		for (int b = 0; b < 256; b++) 
		{
			for (int c = 0; c < 256; c++) 
			{
				for (int d = 0; d < 256; d++)
				{
					if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
					{
						if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
						{
							std::cout << "Found partial key match!" << std::endl
								<< "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
								<< "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
								<< "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
								<< "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
								<< std::endl;

							key[indices[0]] = a;
							key[indices[1]] = b;
							key[indices[2]] = c;
							key[indices[3]] = d;
							return true;
						}
					}
				}
			}
		}
	}

	std::cout << "Could not bruteforce the selected keypart!" << std::endl;
	return false;
}

void printkey(std::array<char, 16> const& key)
{
	std::cout << "Current key:" << std::endl;

	for (char const& ch : key)
	{
		if (ch == 0)
			std::cout << "_";
		else
			std::cout << ch;
	}

	std::cout << std::endl;
	std::cout << std::endl;
}

int main(int argc, char* argv[])
{
	std::array<char, 16> key = { 0 };
	printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
		printkey(key);
	
	if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
		printkey(key);

	std::cout << "Finished bruteforce!" << std::endl;
	std::cin.ignore();
	std::cin.get();
	return 0;
}

 

image.png

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The key was brute forced using quick C++ markup:

image.png.bb01e827a8804b04dc527ee1242575d5.png

 

The following was used to brute force:

#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
  return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
  double product = additive_key +
    (static_cast<double>(k3) * 0.2254315957569856) +
    (static_cast<double>(k2) * -0.06225786672735933) +
    (static_cast<double>(k1) * 0.06576137583312501) +
    (static_cast<double>(k0) * -0.2174719016579794) +
    0.0;
  
  return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
  for (int a = 0; a < 256; a++) 
  {
    for (int b = 0; b < 256; b++) 
    {
      for (int c = 0; c < 256; c++) 
      {
        for (int d = 0; d < 256; d++)
        {
          if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
          {
            if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
            {
              std::cout << "Found partial key match!" << std::endl
                << "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
                << "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
                << "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
                << "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
                << std::endl;

              key[indices[0]] = a;
              key[indices[1]] = b;
              key[indices[2]] = c;
              key[indices[3]] = d;
              return true;
            }
          }
        }
      }
    }
  }

  std::cout << "Could not bruteforce the selected keypart!" << std::endl;
  return false;
}

void printkey(std::array<char, 16> const& key)
{
  for (char const& ch : key)
  {
    if (ch == 0)
      std::cout << "?";
    else
      std::cout << ch;
  }

  std::cout << std::endl;
  std::cout << std::endl;
}

int main(int argc, char* argv[])
{
  std::array<char, 16> key = { 0 };
  printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
    printkey(key);

  std::cout << "Finished bruteforce!" << std::endl;
  std::cin.ignore();
  std::cin.get();
  return 0;
}

 

VirtualPuppet

VirtualPuppet

There are many working keys. One of them is "$^CQE!#(Mrfe%&&$":

image.png.8cae15324ba0e75c7d3d3b06f87f878e.png

 

The following was used to brute force:

#include <iostream>
#include <stdint.h>

#include <array>
#include <functional>

bool isallowed(char c)
{
  return (c != '"' && c != ' ');
}

bool check_keys(double additive_key, char k0, char k1, char k2, char k3)
{
  double product = additive_key +
    (static_cast<double>(k3) * 0.2254315957569856) +
    (static_cast<double>(k2) * -0.06225786672735933) +
    (static_cast<double>(k1) * 0.06576137583312501) +
    (static_cast<double>(k0) * -0.2174719016579794) +
    0.0;
  
  return (product > 0.00001 || product < -0.00001);
}

bool bruteforce(std::array<char, 16>& key, std::array<int, 4> indices, double additive_key)
{
  for (int a = 0; a < 256; a++) 
  {
    for (int b = 0; b < 256; b++) 
    {
      for (int c = 0; c < 256; c++) 
      {
        for (int d = 0; d < 256; d++)
        {
          if (isallowed(a) && isallowed(b) && isallowed(c) && isallowed(d))
          {
            if (!check_keys(additive_key, a, b, c, d) && isprint(a) && isprint(b) && isprint(c) && isprint(d))
            {
              std::cout << "Found partial key match!" << std::endl
                << "a = " << a << "('" << static_cast<char>(a) << "')" << std::endl
                << "b = " << b << "('" << static_cast<char>(b) << "')" << std::endl
                << "c = " << c << "('" << static_cast<char>(c) << "')" << std::endl
                << "d = " << d << "('" << static_cast<char>(d) << "')" << std::endl
                << std::endl;

              key[indices[0]] = a;
              key[indices[1]] = b;
              key[indices[2]] = c;
              key[indices[3]] = d;
              return true;
            }
          }
        }
      }
    }
  }

  std::cout << "Could not bruteforce the selected keypart!" << std::endl;
  return false;
}

void printkey(std::array<char, 16> const& key)
{
  for (char const& ch : key)
  {
    if (ch == 0)
      std::cout << "?";
    else
      std::cout << ch;
  }

  std::cout << std::endl;
  std::cout << std::endl;
}

int main(int argc, char* argv[])
{
  std::array<char, 16> key = { 0 };
  printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 0, 4, 8, 12 }}, -0.255666))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 1, 5, 9, 13 }}, 16.80323))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 2, 6, 10, 14 }}, 10.05288))
    printkey(key);
  
  if (bruteforce(key, std::array<int, 4> {{ 3, 7, 11, 15 }}, 13.157277))
    printkey(key);

  std::cout << "Finished bruteforce!" << std::endl;
  std::cin.ignore();
  std::cin.get();
  return 0;
}

 

×
×
  • Create New...