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 ...
- 11-05-2007 #1
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
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.Code:F018F077B092C093A100G138B131C025D085E097C114D124F135C013E104G109B113D095A110
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
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.Code:char sk[]=" *standard key or ASCII* char dk[]=" *randomly generated hash of characters to go over "
Would something like this just be a headache to code, or should I give it t a shot?
- 11-05-2007 #2
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:
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.Code:cryptography tutorial cryptology tutorial cryptography "snake oil" cryptology "snake oil"
Hope this helps.
- 11-05-2007 #3
- 11-05-2007 #4
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.


Reply With Quote
