并行暴力算法 GPU
Parallel Brute Force Algorithm GPU
我已经在 Python 中实现了并行 BF 生成器,就像在这个 Post 中一样!
Parallelize brute force generation.
我想在 GPU 上实现这种并行技术。应该像 GPU 上的并行 BF 生成器。
有人可以帮我提供一些 GPU 上并行 BF 生成器的代码示例吗?
在网上找不到任何让我怀疑的例子。
看看这个实现 - 我用这段代码在 GPU 上进行了分发:
void IncBruteGPU( unsigned char* theBrute, unsigned int charSetLen, unsigned int bruteLength, unsigned int incNr){
unsigned int i = 0;
while(incrementBy > 0 && i < bruteLength){
int add = incrementBy + ourBrute[i];
ourBrute[i] = add % charSetLen;
incrementBy = add / charSetLen;
i++;
}
}
这样称呼它:
// the Thread index number
int idx = get_global_id(0);
// the length of your charset "abcdefghi......"
unsigned int charSetLen = 26;
// the length of the word you want to brute
unsigned int bruteLength = 6;
// theBrute keeps the single start numbers of the alphabeth
unsigned char theBrute[MAX_BRUTE_LENGTH];
IncrementBruteGPU(theBrute, charSetLen, bruteLength, idx);
祝你好运!
我已经在 Python 中实现了并行 BF 生成器,就像在这个 Post 中一样! Parallelize brute force generation.
我想在 GPU 上实现这种并行技术。应该像 GPU 上的并行 BF 生成器。
有人可以帮我提供一些 GPU 上并行 BF 生成器的代码示例吗?
在网上找不到任何让我怀疑的例子。
看看这个实现 - 我用这段代码在 GPU 上进行了分发:
void IncBruteGPU( unsigned char* theBrute, unsigned int charSetLen, unsigned int bruteLength, unsigned int incNr){
unsigned int i = 0;
while(incrementBy > 0 && i < bruteLength){
int add = incrementBy + ourBrute[i];
ourBrute[i] = add % charSetLen;
incrementBy = add / charSetLen;
i++;
}
}
这样称呼它:
// the Thread index number
int idx = get_global_id(0);
// the length of your charset "abcdefghi......"
unsigned int charSetLen = 26;
// the length of the word you want to brute
unsigned int bruteLength = 6;
// theBrute keeps the single start numbers of the alphabeth
unsigned char theBrute[MAX_BRUTE_LENGTH];
IncrementBruteGPU(theBrute, charSetLen, bruteLength, idx);
祝你好运!