-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from VerisimilitudeX/GPU-MD5-Crack
Adds time to crack passcode based on system hardware [Feature]
- Loading branch information
Showing
11 changed files
with
201 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: PSScriptAnalyzer | ||
|
||
on: | ||
push: | ||
branches: [ "main", "GPU-MD5-Crack" ] | ||
pull_request: | ||
branches: [ "main", "GPU-MD5-Crack" ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: write # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: write # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
name: PSScriptAnalyzer | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run PSScriptAnalyzer | ||
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f | ||
with: | ||
path: .\ | ||
recurse: true | ||
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"' | ||
output: results.sarif | ||
|
||
- name: Upload SARIF results file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: results.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,13 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# | ||
# https://github.com/microsoft/action-psscriptanalyzer | ||
# For more information on PSScriptAnalyzer in general, see | ||
# https://github.com/PowerShell/PSScriptAnalyzer | ||
|
||
name: PSScriptAnalyzer | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
schedule: | ||
- cron: '29 8 * * 0' | ||
|
||
permissions: | ||
contents: read | ||
|
||
name: Run powershell script for PasswordLLM | ||
on: [push] | ||
jobs: | ||
build: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
name: PSScriptAnalyzer | ||
runs-on: ubuntu-latest | ||
Download_and_Run: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run PSScriptAnalyzer | ||
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f | ||
with: | ||
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options. | ||
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules. | ||
path: .\ | ||
recurse: true | ||
# Include your own basic security rules. Removing this option will run all the rules | ||
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"' | ||
output: results.sarif | ||
|
||
# Upload the SARIF file generated in the previous step | ||
- name: Upload SARIF results file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: results.sarif | ||
- name: Check out code | ||
uses: actions/checkout@v2 | ||
|
||
|
||
- name: Run the program | ||
shell: pwsh | ||
run: .\PasswordLLM-Installer.ps1 $True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
pub mod cal_time { | ||
use round::{round, round_up}; | ||
use thousands::Separable; | ||
|
||
pub fn cal_time(GFLOP_64: u64, Entropy: f64) -> u64 { | ||
let MD5_Hashrate: u64 = (GFLOP_64 * 124) * 1000000; | ||
let combinations = round(f64::powf(2.0, Entropy), 0); | ||
|
||
println!("Possible Combinations {}", combinations.separate_with_commas()); | ||
let time_sec = round_up((combinations / MD5_Hashrate as f64) / 2.0, 0); | ||
println!("Time: {} seconds", time_sec.separate_with_commas()); | ||
return time_sec as u64 | ||
// 29,586,412,362,451 / 51584000000 = 573 seconds to crack | ||
} | ||
} | ||
pub mod test { | ||
#[test] | ||
pub fn check_time() { | ||
let GFLOP_64: u64 = 416; | ||
let Entropy = 44.75; | ||
|
||
use crate::cal_time; | ||
let result = cal_time(GFLOP_64, Entropy); | ||
|
||
assert_eq!(result, 287) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#[allow(non_snake_case)] | ||
|
||
pub mod gpu { | ||
use opencl3::device::{get_all_devices, CL_DEVICE_TYPE_GPU}; | ||
use std::io; | ||
pub fn obtainGPU() -> Result<u32, ()> { | ||
let devices: Vec<*mut std::ffi::c_void> = get_all_devices(CL_DEVICE_TYPE_GPU).expect("Cannot detect a GPU!"); | ||
let mut gpu_choice: u32 = 0; | ||
|
||
if devices.len() > 1 { | ||
loop { | ||
println!("You have multiple ({}) GPUs, please select one!", devices.len()); | ||
for gpu in 0..devices.len() { | ||
let device = devices[gpu]; | ||
let device = opencl3::device::Device::new(device); | ||
println!("\tGPU Device {}: {}", gpu, device.name().unwrap()); | ||
} | ||
print!("Selection: "); | ||
|
||
let mut tree = String::new(); | ||
io::stdin().read_line(&mut tree).expect("Failed to read line"); | ||
let water = tree.trim(); | ||
|
||
match water.parse::<u32>() { | ||
Ok(_) => { | ||
gpu_choice = water.parse().unwrap(); | ||
if gpu_choice > devices.len() as u32 { | ||
panic!("Please select a valid GPU!") | ||
} | ||
break; | ||
} | ||
Err(_) => { | ||
println!("Please type a number!"); | ||
} | ||
} | ||
} | ||
} | ||
println!("You have selected GPU Device {}", gpu_choice); | ||
let gpu = opencl3::device::Device::new(devices[gpu_choice as usize]); | ||
let gpu_clock = gpu.max_clock_frequency().unwrap(); | ||
let gpu_cores = gpu.max_compute_units(); | ||
let gpu_cores = gpu_cores.unwrap(); // use ? | ||
let gpu_cores = gpu_cores * 8; | ||
|
||
let gpu_gflops_FP32: u32 = (gpu_clock * gpu_cores * 2) / 1000; | ||
let gpu_gflops_FP64 = ((gpu_clock * gpu_cores * 2) / 4) / 1000; | ||
|
||
println!("Your GPU has a clock speed of {} MHz", gpu_clock); | ||
println!("Your {} has {} CUDA cores or {} stream multiprocessors", gpu.name().unwrap(), gpu.max_compute_units().unwrap(), (gpu.max_compute_units().unwrap() * 8)); | ||
println!("This GPU has {} GFLOPS for FP32!", gpu_gflops_FP32.to_string()); // todo format properly | ||
println!("Or {} GFLOPS for FP64!", gpu_gflops_FP64); | ||
Ok(gpu_gflops_FP64) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters