Find the answer to your Linux question:
Results 1 to 4 of 4
I'm not really sure if this belongs here, but does anyone have any books on cryptology and specifically coding ciphers with C? I've produced one already that's pretty nice, it's ...
  1. #1
    Linux Newbie SagaciousKJB's Avatar
    Join Date
    Aug 2007
    Location
    Yakima, WA
    Posts
    162

    Cipher programs in C

    I'm not really sure if this belongs here, but does anyone have any books on cryptology and specifically coding ciphers with C? I've produced one already that's pretty nice, it's a pretty complex substitution cipher, the only problem is that at current point in time, it has a static key. It was a nice little pet project to code up, but I'm wondering what potential it could actually have with a dynamic key.

    Just for an example, possibly to get anyone interested, this is a sample of my code so far..

    Code:
    C015D075C093G097G106F137D133G029B083G099C114B122A130C013G106G109E116B093C112
    Code:
    F018F077B092C093A100G138B131C025D085E097C114D124F135C013E104G109B113D095A110
    I'm pretty sure that it could be cracked easily if it only has a static key, but I'm not sure how I would work that into the current cipher. The only real way it seems possible would be to code in another substitution cipher to be read AS the key. I have a program that generates random characters, and I think that I could probably just mash this against the ASCII library to create random keys that are themselves substitution ciphers.

    The only problem is that I have no real knowledge of this sort of stuff. This cipher is something I created as a kid and have just gradually built up over time. I've picked up a little knowledge about cryptography over the years, but mostly just around the concepts; It's hard to transform the idea into code.

    What I figured I could do is put the keys into some arrays, as my program currently uses arrays anyway to handle special characters, I figure I could map the entire key in this area. Something like

    Code:
    char sk[]=" *standard key or ASCII*
    char dk[]=" *randomly generated hash of characters to go over "
    I think if I could find enough examples and learn enough about cryptography I could probably modify my existing code somehow to use some kind of substitution cipher with the two arrays, and then pass on that value to the real mechanics of the program. This way, I could then use the same construct to decrypt it. I would obviously still have to somehow keep the standard key from being known, but I could then release it for use to others, but I don't know if it's worth the effort with other, better things out there.

    Would something like this just be a headache to code, or should I give it t a shot?

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    If you just want a toy to sharpen your programming skills, you have a good project there!

    If you eventually want something that's effective cryptography, google these terms:
    Code:
    cryptography tutorial
    cryptology tutorial
    cryptography "snake oil"
    cryptology "snake oil"
    For a fun read, go here. It's a bit outdated, especially in the area of U.S. munitions export restrictions (the U.S. has a more reasonable view now), but otherwise a lot of this ancient wisdom is still applicable.

    Hope this helps.

  3. #3
    Linux Newbie SagaciousKJB's Avatar
    Join Date
    Aug 2007
    Location
    Yakima, WA
    Posts
    162
    Quote Originally Posted by wje_lf View Post
    If you just want a toy to sharpen your programming skills, you have a good project there!

    If you eventually want something that's effective cryptography, google these terms:
    Code:
    cryptography tutorial
    cryptology tutorial
    cryptography "snake oil"
    cryptology "snake oil"
    For a fun read, go here. It's a bit outdated, especially in the area of U.S. munitions export restrictions (the U.S. has a more reasonable view now), but otherwise a lot of this ancient wisdom is still applicable.

    Hope this helps.
    That did help a lot, but I'm still wondering if there are any cryptography books or guides out there revolving specifically around C. I haven't been able to find anything myself, but I guess I don't really know what to search for in that respect.

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    I waddled over to the bookshelf and pulled down my old copy of Bruce Schneier's Applied Cryptography. It doesn't "revolve" around C, and I don't think you're going to find any in-depth cryptography book that revolves around C. But it does have around a hundred pages of C source code in the back.

    Bruce Schneier knows what he's talking about. This is about as close as you're going to get, I suspect.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...