Examples of PasswordAnalysis


Examples of org.owasp.passfault.PasswordAnalysis

   */
  @Test
  public void testDup() {
    System.out.println("process");

    PasswordAnalysis password = new PasswordAnalysis("abcabc");
    PathCost cost = new PathCost(password);
    cost.addPattern(new PasswordPattern(3, 3, "abc", 100, "test pattern"));
    cost.addPattern(new PasswordPattern(0, 3, "abc", 100, "test pattern"));

    RepeatingPatternFinder instance = new RepeatingPatternFinder();

Examples of org.owasp.passfault.PasswordAnalysis

    }
   
    @Test
    public void testAnalyze_repeating() throws Exception {
        System.out.println("analyze");
        PasswordAnalysis pass = new PasswordAnalysis("eeee");
        KeySequenceFinder instance = new KeySequenceFinder(new EnglishKeyBoard());
        instance.analyze(pass);
        int count = pass.getPossiblePatternCount();
        assertEquals(3, count);
    }

Examples of org.owasp.passfault.PasswordAnalysis

  @Test
  public void testNonDup() {
    System.out.println("process");

    PasswordAnalysis password = new PasswordAnalysis("abcabc");
    PathCost cost = new PathCost(password);
    cost.addPattern(new PasswordPattern(3, 3, "abc", 100, "test pattern"));
    cost.addPattern(new PasswordPattern(0, 3, "xyz", 100, "test pattern"));

    RepeatingPatternFinder instance = new RepeatingPatternFinder();

Examples of org.owasp.passfault.PasswordAnalysis

  @Test
  public void test2dup() {
    System.out.println("process");

    PasswordAnalysis password = new PasswordAnalysis("abcabcabc");
    PathCost cost = new PathCost(password);
    cost.addPattern(new PasswordPattern(6, 3, "abc", 100, "test pattern"));
    cost.addPattern(new PasswordPattern(3, 3, "abc", 100, "test pattern"));
    cost.addPattern(new PasswordPattern(0, 3, "abc", 100, "test pattern"));

Examples of org.owasp.passfault.PasswordAnalysis

  @Test
  public void testDupExtra() {
    System.out.println("process");

    PasswordAnalysis password = new PasswordAnalysis("123abc456abc789");
    PathCost cost = new PathCost(password);
    cost.addPattern(new PasswordPattern(9, 3, "abc", 100, "test pattern"));
    cost.addPattern(new PasswordPattern(3, 3, "abc", 100, "test pattern"));

    RepeatingPatternFinder instance = new RepeatingPatternFinder();

Examples of org.owasp.passfault.PasswordAnalysis

    }
   
    @Test
    public void testAnalyze_extraBeforeAndAfter() throws Exception {
        System.out.println("analyze");
        PasswordAnalysis pass = new PasswordAnalysis("fredasdfcougar");
        KeySequenceFinder instance = new KeySequenceFinder(new EnglishKeyBoard());
        instance.analyze(pass);
        int count = pass.getPossiblePatternCount();
        assertEquals(3, count);
    }

Examples of org.owasp.passfault.PasswordAnalysis

    }
   
    @Test
    public void testAnalyze_extraBeforeAndAfter_MixedCase() throws Exception {
        System.out.println("analyze");
        PasswordAnalysis pass = new PasswordAnalysis("freSdFcougar2WsX");
        KeySequenceFinder instance = new KeySequenceFinder(new EnglishKeyBoard());
        instance.analyze(pass);
        int count = pass.getPossiblePatternCount();
        assertEquals(4, count);
    }

Examples of org.owasp.passfault.PasswordAnalysis

    }

    @Test
    public void testAnalyze_random() throws Exception {
        System.out.println("analyze");
        PasswordAnalysis pass = new PasswordAnalysis("&7U8(b^j(*(l:';");
        KeySequenceFinder instance = new KeySequenceFinder(new EnglishKeyBoard());
        instance.analyze(pass);
        int count = pass.getPossiblePatternCount();
        assertEquals(1, count);
    }

Examples of org.owasp.passfault.PasswordAnalysis

    }

    @Test
    public void testAnalyze_colon() throws Exception {
        System.out.println("analyze");
        PasswordAnalysis pass = new PasswordAnalysis(":");
        KeySequenceFinder instance = new KeySequenceFinder(new EnglishKeyBoard());
        instance.analyze(pass);
        int count = pass.getPossiblePatternCount();
        assertEquals(0, count);
    }

Examples of org.owasp.passfault.PasswordAnalysis

  public void tearDown() throws Exception {
  }

  @Test
  public void randomNumbers() {
    PasswordAnalysis pa = new PasswordAnalysis("1234");
    PathCost patterns = pa.calculateHighestProbablePatterns();

    List<PasswordPattern> list = patterns.getPath();
    assertEquals(1, list.size());
    double result = patterns.getTotalCost();
    System.out.println("cost=" + result);
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.