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
import pywren | |
import time | |
import itertools | |
chars = "abcdefghijklmnopqrstuvwxyziABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890^?!?$%&/()=?`'+#*'~';:_,.-<>|" | |
def brute_force_chars(pin): | |
for guess in list(itertools.product(list(chars),repeat=len(pin))): | |
if pin == len(pin)*'%c' % (guess): | |
return guess |
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
import time | |
import itertools | |
chars = "abcdefghijklmnopqrstuvwxyziABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890^?!?$%&/()=?`'+#*'~';:_,.-<>|" | |
def brute_force_chars(pin): | |
for guess in list(itertools.product(list(chars),repeat=len(pin))): | |
if pin == len(pin)*'%c' % (guess): | |
return guess |
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
import pywren | |
import time | |
import itertools | |
chars = "abcdefghijklmnopqrstuvwxyziABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890^?!?$%&/()=?`'+#*'~';:_,.-<>|" | |
def brute_force_chars(pin): | |
""" Uses itertools to create a cartesian product of the possible passwords """ | |
for guess in list(itertools.product(list(chars),repeat=len(pin))): | |
if pin == len(pin)*'%c' % (guess): |
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
import time | |
import itertools | |
chars = "abcdefghijklmnopqrstuvwxyziABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890^?!?$%&/()=?`'+#*'~';:_,.-<>|" | |
def brute_force_chars(pin): | |
""" Uses itertools to create a cartesian product of the possible passwords """ | |
for guess in list(itertools.product(list(chars),repeat=len(pin))): | |
if pin == len(pin)*'%c' % (guess): | |
return guess |
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
import pywren | |
import time | |
import itertools | |
def brute_force_digits(pin): | |
""" Uses itertools to create a cartesian product of the possible pins """ | |
for guess in list(itertools.product(list(range(10)),repeat=len(str(pin)))): | |
if pin == int(len(str(pin))*'%d' % (guess)): | |
return guess |
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
import time | |
import itertools | |
def brute_force_digits(pin): | |
""" Uses itertools to create a cartesian product of the possible pins """ | |
for guess in list(itertools.product(list(range(10)),repeat=len(str(pin)))): | |
if pin == int(len(str(pin))*'%d' % (guess)): | |
return guess | |
def brute_force_split(pin,n): |
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
import pywren | |
import time | |
import itertools | |
def brute_force_digits(pin): | |
""" Uses itertools to create a cartesian product of the possible pins """ | |
for guess in list(itertools.product(list(range(10)),repeat=len(str(pin)))): | |
if pin == int(len(str(pin))*'%d' % (guess)): | |
return guess |
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
import time | |
import itertools | |
def brute_force_digits(pin): | |
""" Uses itertools to create a cartesian product of the possible pins """ | |
for guess in list(itertools.product(list(range(10)),repeat=len(str(pin)))): | |
if pin == int(len(str(pin))*'%d' % (guess)): | |
return guess | |
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
# | |
# To use these functions, you can run python and then import like - | |
# from binary_adder import * | |
# | |
# These methods carry out binary addition via 'digital logic' | |
# This is really what happens at the logic circuit level. | |
# So, this is a pretty abstract use of programming to illustrate | |
# what happens on silicon using code many, many, levels above that! | |
# |
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
# Pre-req's : loops, conditionals, functions, lists, tuples, and dictionaries | |
# | |
# Python 2.7 | |
# | |
# Objectives: Advanced dictionaries, dictionaries as list indices | |
# Foundational Objectives: Databases | |
# | |
# Remember in the previous lessons, we defined a contact record using the following tuple |
NewerOlder