Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simple code

  1. May 12, 2004 #1
    my friend put up a code on his away message and it was easy to figure out just guessing what it would be. then i put one up and i gave every letter in the alphabet a number... a=1, b=2, etc and then used 4x^2 + 2x + 7 to make them into different larger numbers. one of my smarter friends figured it out. i know all you people are a lot smarter than i am so i was wondering if you'd give me some suggestions on making one up that they wouldn't figure out. thanks for any suggestions
  2. jcsd
  3. May 12, 2004 #2

    where pie is that weird irrational number which goes something liek 3.14... and so on

    i is the square root of -1

    c is the speed of light

    and x is the number you assigned the letter.

    that should keep him up for days
  4. May 29, 2004 #3
    not really, its simple as replacing letters with numbers, they will just look for the most common letter ( like E) then the second most common, if u wanna good code goto www.pgpi.com its a Enciption thingy that the us government can't break
  5. May 29, 2004 #4
    I wouldn't say that, that kind of analysis is only worthwhile when you have enough data to work with. You can't use that method to break the code when all you have is "Hi guys, I'll be back in a couple of days". The most common letters there are L, A and I.
  6. May 29, 2004 #5
    Why not just use RSA but with a relatively small composite number? One that would not take 1,700 computers and 8 months to crack...
  7. May 29, 2004 #6


    User Avatar
    Science Advisor
    Gold Member

    I really don't know a great deal about codes but you could try using to variable rather than one, for example the postion of the letter in the code.
  8. May 29, 2004 #7
    Translate it to Chinese and assign each Chinese character to a LISP function. Compile and run the program and encode the output by using it as a seed to a random number generator. Then subtract one.
  9. May 30, 2004 #8
    the US government will take over 52 million years to crack Pgp's code fopr 1 person!!
  10. May 30, 2004 #9
    The US government has a quantum computer that is capable of breaking any PGP code in a matter of minutes. Oops, did I say that out loud?
  11. May 31, 2004 #10

    Sqrt of -1 = ERROR
    and its Pi, not Pie, and if u put i = sqrt of 1, the answer is 1 and therfore

    (22/7)x root of 1^((3 x 10^8)x the number)

    1 to the power of anything is 1 and the sqrt of 1 is 1 so 22/7 x 1 = 22/7

    so every letter will come up as 22/7 so that doesn't work
  12. Jun 1, 2004 #11
    I do suggest you understand what you're talking about before talking about it. :smile:
  13. Jun 1, 2004 #12
    So whats the Sqrt of -1 chen?
  14. Jun 1, 2004 #13
    It is i. Do you not believe this just because your calculator says it's an error to the take the square root of -1?
  15. Jun 1, 2004 #14
    If you are still interested in cryptography, there are a number of books on the subject.

    For starters, try Cryptanalysis by Helen Fouché Gaines, 1939, which describes some of the basics of this field.

    Next, try Cryptanalysis for Microcomputers by Caxton C. Foster, 1982. I think computers are here to stay, so you may as well read up on the subject.

    And then may I suggest 'Mathematical Cryptology for Computer Scientists and Mathematicians' by Wayne Patterson printed in 1987.

    More items for you would be cryptographers:

    Desirable characteristics of an encryption system:

    The system must not increase the length of the message. If each character is converted to a ten digit number, pretty soon you will run out system capacity. The system must not be vulnerable to the loss or modification of one or more of the characters. If you have noise hits on the line, you may tolerate the loss of one or two characters, but it should not cause the entire message to be lost.

    Modern encryption systems must be capable of handling massive amounts of data, so an attractive approach would modify each character by adding a digit from some infinite sequence such as pi or the national debt.

    More bibliography:
    Infinite Sequences and Series, Konrad Knopp
    The Beale Papers, Library of Congress, 1885
    Handbook of the Beale Ciphers, Per A. Holst
    Fibonacci Numbers, N. N. Vorob'ev
    The Decipherment of Linear B, John Chadwick
    Cryptography, the science of secret writing, Laurence Dwight Smith
    and of course, The Code Book, Simon Singh
    Last edited: Jun 8, 2004
  16. Jun 1, 2004 #15


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Also the "Code Book" by Simon Singh...a very easy read, being fun and instructive at the same time.
  17. Jun 1, 2004 #16


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Here's a simple trick that makes it harder to crack your code, especially for messages that are not huge : assign different numbers to each letter but assign more than one number as possible replacements for some of the less used letters.

    Example :
    a= 7
    c =13, 5
    and so on

    This way, it's much harder to use "frequency analysis" to crack to code.

    Also, the act of thinking up some polynomial function to make the numbers large does nothing to increase the difficulty of cracking the code. This is a wasted step.
  18. Jun 1, 2004 #17
    So, go and make a message using that code, it wont work because u will have it like this

    (22/7) x sqrt of ( i ^ (3 x 10^8) x) will = for any number of the letter the code will end up as if a = 26

    (22/7) x sqrt of ( i ^ (3 x 10^8 )26)

    that will be what will come up for A!!, so why dont you go and write a message using that formula :-/
  19. Jun 2, 2004 #18


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Clearly, pre-multiplying by Pi or anything else doesn't help. And there's problems with using i^ cx. Such a function is strictly a "one-way" function (for large c, different x give the same value of i^cx, so knowing c doesn't help) unless c is small compared to the largest number that x can be. But if c is small enough then this adds no difficulty to the decryption.
  20. Jun 2, 2004 #19
    Actually, there are lots of sources about cryptography on the net, a search on NEC/IST you sure get lots of abstracts among which there are also many a nice tutorial...
    Another downloadable source is from Penn univ (free lib), if that is of your interest...

    But about cryptography that works with imaginary number, is that possible ? i haven't heard of this yet though...
  21. Jun 2, 2004 #20
    Gokul, you are really kewl again!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook