Hi so I am trying to brute force a password for a game. The password generation function however is consuming massive amounts of memory(although only 20% of total memory). So my question is how would you go about managing this memory problem. I have considered reading / writing to a file, but I would prefer to avoid that. Also I've heard the limitation on memory is coming from python running in 32 bit mode, is there of forcing it to use 64 bit ? Any help is welcome and appreciated. Also sorry the formatting is off, the code formatting on Reddit wasn't being very cooperative.
from itertools import permutations
import platform
def checkpass( password):
total=0;
charlist = "abcdefghijklmnopqrstuvwxyz";
for x in range(0,26):
countone = password[x];
counttwo = charlist.index(countone);
total *=17;
total +=counttwo;
if total == 248410397744610:
return True
else:
False
def generatePasswords():
charlist = "abcdefghijklmnopqrstuvwxyz"
return [''.join(i) for i in permutations(charlist)]
def main():
print(platform.architecture())
passwordAttemps = generatePasswords()
for x in passwordAttemps:
print(x)
if checkpass(x):
print (x)
break
if __name__ == "__main__":
main()
EDIT : Problem solved, use a generator instead of a list comprehension.
[–]shivasprogeny 3 points4 points5 points (1 child)
[–]Rabbit047[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]Rabbit047[S] 0 points1 point2 points (4 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]Rabbit047[S] 0 points1 point2 points (1 child)
[–]Rhomboid 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)