From 7bd18b4b22f3a6bf86b131329345f9a75d8f699c Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 28 Aug 2021 09:45:57 -0400 Subject: Commit Rust POC This replaces the Python script. Since all MIT-licensed code is removed, the LICENSE file is as well. 'cargo run' to run the program. Signed-off-by: Malfurious --- GarbageProofOfConcept.py | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100755 GarbageProofOfConcept.py (limited to 'GarbageProofOfConcept.py') diff --git a/GarbageProofOfConcept.py b/GarbageProofOfConcept.py deleted file mode 100755 index e6e4030..0000000 --- a/GarbageProofOfConcept.py +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env python - -import hashlib -from itertools import combinations - -data = b"abc" -length = len(data) - -hexdigest = hashlib.sha256(data).hexdigest() -print(hexdigest) - -lookupTable = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, - 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, - 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, - 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, - 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, - 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, - 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, - 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, - 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, - 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, - 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, - 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8] - -sum1 = 0 -for i in range(length): - sum1 += lookupTable[bytearray(data)[i]] - -print("The length is: {0}".format(length)) -print("The ones count is: {0}".format(sum1)) - -combinations = list(combinations(range(length * 8),sum1)) -numCombs = len(combinations) - -count = 1 -for comb in combinations: - print("Trying {0}/{1}".format(count, numCombs)) - count += 1 - a = [0] * length - for bit in comb: - a[bit//8] |= 1 << (bit % 8) - if hashlib.sha256(bytearray(a)).hexdigest() == hexdigest: - print("Found! {0}".format(a)) - break -else: - print("failed to find") -- cgit v1.2.3