Announcement

Collapse
No announcement yet.

Help creating a cryptogram

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help creating a cryptogram

    Hello, all... I am new to python, learning the basics..and to be honest I'm not very good at it. I have an assignment where I have to create a cryptogram..I just don't know where to start. If someone can get me pointed in the right direction I can usually gain momentum and figure out the assignment. That being said, if anyone could show me an outline or a sample of a past one you've created to help me write one of my own I would appreciate it. also we use python 3. Thank you!

  • #2
    Originally posted by wjhowell89 View Post
    Hello, all... I am new to python, learning the basics..and to be honest I'm not very good at it. I have an assignment where I have to create a cryptogram..I just don't know where to start. If someone can get me pointed in the right direction I can usually gain momentum and figure out the assignment. That being said, if anyone could show me an outline or a sample of a past one you've created to help me write one of my own I would appreciate it. also we use python 3. Thank you!
    A cryptogram is just a piece of text where you substitute each letter in the cryptogram for a letter in the original. Every time there's an i, say, in the original, you use another letter, like x (in my example), and every time there's an a, for instance, in the original you use another letter, like r; the crucial thing is always to substitute the same letter for the all examples of one letter in the original, and not to use the same letter for two different original letters. So 'I have an assignment' would be 'x wrhj rf rddxbfojfm' (I hope I did that right!). I guess that the goal of the assignment is to figure out how to substitute one letter for another using Python, rather than paper and pencil. Good luck!

    Comment


    • #3
      You could cheat and use a ROT13 converter, which just shifts all the letters halfway around the alphabet. Around here, we can read that like it was uncoded, so you probably couldn't fool your teacher. I'm unfamiliar with Python. This sounds more like a computer assignment than one for encryption.

      Comment


      • #4
        Originally posted by Lurker View Post
        Around here, we can read that like it was uncoded...
        I don't think I would recognize the whole code that easily. I would still just see the word patterns.

        wjhowell89: Making a cryptogram is simple. You first create the code by writing the alphabet and then assigning a unique code letter to each alphabet letter. You could ensure the code letters are unique by writing a second alphabet and crossing off each letter as you assign it. Then, once you have the code alphabet set up, just choose a short passage of writing and rewrite it using the code letters from your code alphabet. (Did I explain that clearly??)

        Note: What I described is how you create a cryptogram by hand. If you are asking how to create a cryptogram using a computer program, I have no clue. We solve the puzzles at this site using only our brains, eyes, and fingers. The person who built the site may be able to help you, since he does in fact use software to generate cryptograms for us to solve. You can reach him via the "Questions or Comments" box at the foot of this page.

        Comment


        • #5
          There is a web site that will do it automatically for you. Look for 'create cryptogram'.

          Comment


          • #6
            """
            This is a simple cryptoquip: a phrase that needs to be solved.
            """

            from random import shuffle, random, choice
            from scramble import *
            from puns001 import *
            import re

            letters= ['a','b','c','d','e','f','g','h','i','j',
            'k','l','m','n','o','p','q','r','s','t',
            'u','v','w','x','y','z'] #keys that match the phase

            nums= [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
            17,18,19,20,21,22,23,24,25] # number of keys minus one

            L= letters[:] # copy to be the values

            shuffle(L) # randomly mix values
            ran_let= scramble3(L)[choice(nums)] # scramble values and pick one

            quip_d= dict(zip(letters, ran_let)) # make a dicionary of keys and values
            d2= {'?':'?',"'":"'",'.':'.',':':':',
            '!':'!',',':',','-':'-','!':'!',}

            quip_d.update(d2)
            #print(quip_d)


            pick_p= choice(phrase) # randomly pick a phrase
            keys= []
            #print(pick_p.lower())
            res= [] #empty list to hold the mixed phrase
            for x in pick_p.lower(): #take each individual letter in phrase
            z= quip_d.get(x, ' ') #get the value from key
            res.append(z) #add to the new list


            hint_letter= choice(pick_p.lower())
            print("your hint is: ", hint_letter, '=', quip_d[hint_letter])


            print('Solve: ',res ) # show the puzzle
            prompt= 'Answer: '
            goal= 0 # to switch off with correct answer.
            while goal < 1: #main part you need to type the exact phrase.

            guess= input(prompt)
            if pick_p == guess:
            print('Winner winner chicken dinner')
            goal +=1
            else:
            print('Wrong keep trying')

            Comment


            • #7
              Originally posted by joejustjoe View Post
              """
              This is a simple cryptoquip: a phrase that needs to be solved.
              """
              Joejustjoe, what is the point of your post?

              Comment


              • #8
                LLapp

                It appears to be a crypto generating program, though I'm not familiar with the language.

                Not sure how well it works. One key is to make sure the encrypted letter is not the same as the plain text letter. I don't spot a test to make sure that is the case.

                The other key is to make sure that a given encrypted letter is used for only one plain text letter. I don't understand the setup well enough to be sure that is the case.

                Comment

                Working...
                X