Example #1
0
  public void run() {
    RailFence rf = new RailFence();
    String plainText = rf.decrypt(cypherText, key);
    double score = scorer.getScore(plainText);

    Resultable r = new Result(plainText, key, score);

    try {
      queue.put(r);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }
Example #2
0
  public void run() {
    RailFence rf = new RailFence(); // create railfence obj

    String plainText = rf.decrypt(cypherText, key); // decrypt the cypher text using a given key
    // get the score
    double score = ts.getScore(plainText); // get the score of text

    Resultable r = new Result(plainText, key, score); // Create a result object with text,key,score

    try {
      queue.put(r); // put r on the queue
      System.out.println("object added");
    } catch (InterruptedException e1) {
      e1.printStackTrace();
    }
  }