Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by davej

  1. As Ingolme says, you have the decryption code and obviously Javascript is the only reasonable language choice. The problem is choosing passwords and detecting success. Now, as an example, if you know that the successful decryption will result in a phrase that contains one of the English words; "the", "and", or "is" then an "appropriate test" you might use;

    test = toLowerCase(test);
    
    if(test.indexOf('the') != -1 || test.indexOf('and') != -1 || test.indexOf('is') != -1){
        alert(test);
    }

    or this might be better...

    var t = toLowerCase(test);
    if(t.indexOf(' the ') != -1 || t.indexOf(' and ') != -1 || t.indexOf(' is ') != -1){
       alert(test);
    }

     

    • Thanks 1
×
×
  • Create New...