Skip to main content

Madness

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #44676
    Jfairy
    Member

    Madness how do you always manage to submit first! Do you have some program which automatically pulls stuff from the webpage and then submits it or do you just use your program very quickly?

    #44701
    Madness
    Member

    > Do you have some program which automatically pulls stuff from the webpage?
    yes

    > and then submits it?
    for the usual ciphers

    > or do you just use your program very quickly?
    for the other ciphers, yes

    So far it has been working relatively well. There have been two problems, but I got
    past them.

    Just so you know:
    1. I am not eligible for prizes, so you don’t have to complete with me. You may, if you
    want to work on your own coding skills. I certainly don’t want to discourage anyone, and
    I welcome the competition.
    2. I write all of my own programs. No cheating.
    3. I have been assuming that there are others who automate much of things. That’s why I
    worked so hard to get my tools to be fast. I suspect that Cribbage and Chiffre Dechiffrable
    have a similar setup. Are you two here and want to respond?

    I am happy to discuss how to automate, and techniques for cracking various ciphers. Ask any
    question, and I’ll say whatever Harry will allow.

    #44708
    Gsemple
    Member

    I’m team Chiffre Déchiffrable and I have been trying to implement solvers for ciphers from previous years in python. I’m aiming to rewrite most of it in C for next year as python gets quite slow. What language do you do it in?

    #44715
    Jfairy
    Member

    I have currently got all my programs in python too, but if I go much further should really transfer to C.
    I don’t know much about the communication with other applications so have to input everything manually into my programs which sometimes means that I submit quite late if I’m busy. This is my second and last year competing (my team is intellect devourers) I’ll probably carry on in future years and try to get quicker along the way (I’ll be doing a degree in maths)
    Out of interest which algorithms are you both using for substitution and transposition? I use simulated annealing and a key space search although these both feel a little on the inefficient side. (I don’t have the best setup on my sim-anneal what ngrams do you find best?).

    #44714
    Epicgeeth
    Member

    Well now I have plans for next year…

    #44716
    Cribbage
    Member

    Madness has indeed been awesome. It is very difficult to see how Madness could have submitted solutions so quickly to the challenges in the recent rounds without a thorough understanding of how to analyse the encrypted messages. The playfulness in the twists on the ciphers used means that dependence on previously written code will only get you so far. That has been my experience this year (my second year, and what a great year it has been already – thanks Harry!). I too have written my own set of cipher-cracking and word segmentation tools, but the most enjoyment has come when the challenges have gone beyond what they can accomplish.

    The programming language I have used: I have put the tools on a website, largely because I am not always at the same computer when the challenges are released. The tools are written in PHP, with some of the basic frequency analysis functions written in JavaScript. Every now and then I think about rewriting them in C++ for real speed, but it has not really felt necessary up to now. If I feel tempted to resort to that much computational power then it is normally because I have missed something which would narrow the amount of processing required to crack the message.

    #44730
    Harry
    Keymaster

    Thanks Cribbage, glad you are enjoying it!

    Harry

    #44721

    I’m interested in how you automatically take the ciphers from the website Madness, is it just url requests and then parsing to get the required data? I am also interested in what language you use, I currently use python but have been considering moving over to julia as it is similarly high-level but much faster, and I coding too much C hurts my brain.

    #44731
    Harry
    Keymaster

    Ingenious.
    There was one year when we posted the last challenge as a gif, just to slow everyone down!
    Muhaha!

    Harry

    #44743
    Madness
    Member

    @Jfairy Yes, moving some programs to C would benefit you.

    For mono substitutions, I do not use annealing. I use Jakonsen’s 1995 algorithm, and find that
    there is no need for a “temperature”. For that I use tetragrams (4). This one is in C.

    For transpositions, if I know the keylength, I do a stochastic hill climb with a constant
    “temperature”/jitter. For each iteration, I swap two elements of the permutation key.
    It’s fast enough that I can try lots of keylengths until I get a good fitness.
    For that I am still using trigrams. This one is in Python.

    #44748
    Epicgeeth
    Member

    The BeautifulSoup library is probably a good way to parse the webpage and extract the ciphertext for anyone using python.

    #44746
    Madness
    Member

    @Gsemple
    I am using Python and C. Sometimes I use Python for one part of a cipher, but then it calls
    a C program for another part. For that I use the “subprocess” module. It’s nice, because
    classifying the cipher is easier in Python anyway.

    #44768
    Madness
    Member

    So, Harry’s not letting me post code on how to download the ciphertexts, so here are some
    suggestions: The wget program works in a terminal or script to get pages. Then you can use
    other tools to cut the ciphertext out of the page. Wget is on Mac and linux, and I seem to
    remember seeing a Windows executable once.

    In Python, the “requests” library gets web pages and remembers cookies, etc. In python it
    should be easy, once you have the web page, to cut out the ciphertexts and save them.

    #44774
    Harry
    Keymaster

    Thanks for your patience, Madness. Figured it was more valuable letting people try to work this out for themselves, but the hints are good. Keep them coming!

    #44745
    Madness
    Member

    @Cribbage
    What was your submission time last year for 10B? Just curious. My Python program took
    almost 2 hours. I have a C version now that is much faster.

    You have me intrigued about your use of your own website. Did you make forms so that you
    copy and paste into text inputs, then wait for the result? Did you make the site private?

    If you ever want to break a Playfair cipher, you will definitely feel the need for more speed!

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.