Thread: Simple(?) substitution cipher help

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by kalor_alros View Post
    My first question still goes back to the table... would I use a character array, 5X5, to enter the alphabet into? Or is there a simpler way to accomplish the same thing?
    No reason not to. It doesn't get any simpler than a 5x5 array -- after all that's just a block of 25 bytes for you to use.

  2. #17
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by IceDane View Post
    I sincerely hope you aren't serious.

    You do realize that the strength of an encryption algorithm should not depend on how well you can hide the algorithm itself, right? I could easily give you a bunch of random letters and tell you to crack it, but the challenge wouldn't be to break the algorithm, but rather to discover it.

    Your friend at the NSA should tell you this.
    Actually you are wrong about that, as one of the jobs of a cryptananlist is doing exactly such discovery, since the enemy will not always provide you with the algorithm they use.

    And knowing the algorithm would not aid you in any way. I don't reveal it because it is a trade secret and posting it on a forum where foreign nationals are KNOWN to frequent would be a felony.
    Last edited by abachler; 09-01-2009 at 12:49 PM.

  3. #18
    Registered User
    Join Date
    Aug 2009
    Posts
    19
    unless I'm wrong, that is what he meant... merely cracking the code IS important, but discovering the algorithm that generates it is far more important, since later messages in the same algorithm might as well be plaintext.

  4. #19
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by kalor_alros View Post
    unless I'm wrong, that is what he meant... merely cracking the code IS important, but discovering the algorithm that generates it is far more important, since later messages in the same algorithm might as well be plaintext.
    Not really. even knowing the algorithm behind AES doesn't make messages encrypted with AES plaintext.

  5. #20
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149
    It does if you know the key though, which kalor seems to take to be part of knowing the algorithm. In a sense it is.
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  6. #21
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by King Mir View Post
    It does if you know the key though, which kalor seems to take to be part of knowing the algorithm. In a sense it is.
    I take it you mean because in order to know the algorithm, one would have to break the cypher.

    I think IceDane made a distinction that doesn't apply. In the absence of an algorithm, the problem that is presented to a cryptanalyst is that of solving the cypher. The distinction between algorithm and plaintext is blurred in the methods used to achieved this, assuming no further knowledge can be gained. Probably -- this is my guess -- under many circumstances one can even only construct the algorithm after they solved the cypher. If it can be constructed at all... (edit: incidentally this last statement does give IceDane some credit. hmm...)

    I believe abachler to be quite right in that not knowing the algorithm is a strong weapon. Today we do have algorithms that give away nothing; AES, Blowfish, etc. So this isn't such an important issue anymore. In any case, for weaker algorithms this can still be an important concept.
    Last edited by Mario F.; 09-01-2009 at 10:00 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  7. #22
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by IceDane View Post
    You do realize that the strength of an encryption algorithm should not depend on how well you can hide the algorithm itself, right? I could easily give you a bunch of random letters and tell you to crack it, but the challenge wouldn't be to break the algorithm, but rather to discover it.
    Why is that any less fun?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  8. #23
    Registered User
    Join Date
    Aug 2009
    Posts
    19
    I did mis-state myself earlier... I did imply that the key is part of the algorithm, which in a wierd sense, it is, but it wasnt really what I meant. I meant more (and was looking the wrong way at it, and my approach wouldnt have worked well) like, in attempting to break the cipher, one could attack the algorithm itself, using it to produce a key, testing against the encrypted text, repeat as necessary. A faulty approach, now that I think more about it.

    Could it, in theory, be possible to use a key as a weapon against the same algorithm? This is more what I had in mind. With both the plaintext and encrypted text in hand, together with a key (which you successfully broke, so you know that it is genuine), would it be possible to perhaps, use the data to generate other keys, regardless of strength? Especially if you could then encrypt the plaintext you had before, compare for similarities and patterns, and start compiling methods to come to the same result? I wouldn't expect it to be done in a person's lifetime against a REAL encryption system, but it would eventually yield results, right? (long after the entire system was trashed for the new version, but still).

    I guess it would be like trying to reproduce a door key for every house in the world, and then some, based off the information gleaned from ONE house key... but is it possible?

  9. #24
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by King Mir View Post
    It does if you know the key though, which kalor seems to take to be part of knowing the algorithm. In a sense it is.
    Well, if you are going to claim success because you completely fail to comprehend the subject matter then there's no point in continuing the discussion.

    But yes, if I tell you how to decrypt it and then tell you the key, its trivial to crack, and there isn't a single useful algorithm in the world that would provide the least bit of security in that case.

    Generally no, given a plaintext, key and ciphertext and the algorithm, it is not possible to instantly read ciphertext created with other keys.
    Last edited by abachler; 09-02-2009 at 12:27 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. creating very simple text editor using c
    By if13121 in forum C Programming
    Replies: 9
    Last Post: 10-19-2010, 05:26 PM
  2. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  3. Substitution Cipher Program Problem...
    By Junior89 in forum C++ Programming
    Replies: 13
    Last Post: 12-28-2005, 05:02 PM
  4. Simple message encryption
    By Vicious in forum C++ Programming
    Replies: 10
    Last Post: 11-07-2004, 11:48 PM
  5. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM