def setUp(self): self.wordlist_full = xkcd_password.generate_wordlist( wordfile='3esl.txt', min_length=5, max_length=8,) self.wordlist_small = xkcd_password.generate_wordlist( wordfile='tests/test_list.txt', valid_chars='[a-z]')
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </pre> </html> """ import webapp2 import logging # import the generate_xkcdpassword and generate_wordlist functions from xkcd_password import generate_wordlist, generate_xkcdpassword # create a wordlist mywords = generate_wordlist(wordfile='static/italian.txt', min_length=3, max_length=8,) logging.getLogger().setLevel(logging.DEBUG) logging.info("wordlist generata") class MainHandler(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/html; charset=UTF-8' self.response.write(homepage) class Generate(webapp2.RequestHandler): def get(self): nwords = self.request.get('nwords') acrostic = self.request.get('acrostic') passwd = 'error'
# import the generate_xkcdpassword and generate_wordlist functions from xkcd_password import generate_wordlist, generate_xkcdpassword # create a wordlist mywords = generate_wordlist(wordfile='3esl.txt', min_length=5, max_length=8,) # create a password with the acrostic 'face' print(generate_xkcdpassword(mywords, acrostic="face"))
# import the generate_xkcdpassword and generate_wordlist functions from xkcd_password import generate_wordlist, generate_xkcdpassword # create a wordlist mywords = generate_wordlist( wordfile='3esl.txt', min_length=5, max_length=8, ) # create a password with the acrostic 'face' print(generate_xkcdpassword(mywords, acrostic="face"))
def _generate_password(): wordfile = xkcd_password.locate_wordfile() mywords = xkcd_password.generate_wordlist(wordfile=wordfile, min_length=4, max_length=8) return xkcd_password.generate_xkcdpassword(mywords, delim='-', n_words=3)
__FILENAME__ = example_import # import the generate_xkcdpassword and generate_wordlist functions from xkcd_password import generate_wordlist, generate_xkcdpassword # create a wordlist mywords = generate_wordlist(wordfile='3esl.txt', min_length=5, max_length=8,) # create a password with the acrostic 'face' print generate_xkcdpassword(mywords, acrostic="face") ########NEW FILE######## __FILENAME__ = xkcdp_tests import unittest import subprocess import xkcd_password class XkcdPasswordTests(unittest.TestCase): def setUp(self): self.wordlist_full = xkcd_password.generate_wordlist( wordfile='3esl.txt', min_length=5, max_length=8,) self.wordlist_small = xkcd_password.generate_wordlist( wordfile='tests/test_list.txt', valid_chars='[a-z]') def test_loadwordfile(self): self.assertEquals(len(self.wordlist_full), 10730) def test_regex(self):