-1

I need to implement a simple text encryption in C++ without using any existing framworks. This is purely for educational purpose to learn the in-and-outs and to learn the way to implement such a system. I am not planning to implement this in production code. I can use Windows APIs but it won't be cross platform. I am trying to learn something can work across multiple platforms. the best way to implement this is implement using C/C++. Please share good resources or links in this regard.

sarat
  • 10,512
  • 7
  • 43
  • 74
  • 8
    Encryption *without* using any existing frameworks is just asking for trouble. This is **not** something where you should feel free to reinvent the wheel. – Cody Gray - on strike May 17 '11 at 10:21
  • 2
    How simple is simple? Caesar cipher, ROT13, or do you want strong cryptophy? – Rup May 17 '11 at 10:22
  • 4
    Is "without... frameworks" meant to mean no libraries, that you only want a simple system you can put together yourself? Then why the aes and public key etc. tags? - they're not simple enough for someone who has to ask for leads.... If you are writing from scratch, then some other details would be useful: e.g. are both sides trusted?, can they securely exchange data in advance of the potentially eves-dropped-on exchanges? is it practical to put an upper limit on the volume of data they might exchange? Potentially, your solution could be as simple as a one time pad and XOR.... – Tony Delroy May 17 '11 at 10:24
  • It's for learning purpose. I am not going to use it in the public place or re-implement the entire things. I was trying to implement something something cross platforms using C/C++. So that I can learn things myself. – sarat May 17 '11 at 10:24
  • I updated the question details. – sarat May 17 '11 at 10:29
  • 1
    You could try, "Applied Cryptography" (Schneier), it's a decent introduction and covers simple encryption, but it's 15 years old and hence doesn't cover AES at all. "Cryptography Engineering" (Ferguson, Schneier, Kohno) is more recent, but I haven't read it and don't know what's in it. – Steve Jessop May 17 '11 at 10:31

1 Answers1

3

Depending on what you actually want, you could look at the CipherSaber project: instructions to implement your own RC4 encryption code for a simple IV+text format.

However this is an academic exercise only: you should never use your own crypto code in production unless you really know what you're doing. You could also read Schneier's Applied Cryptography for a good introduction to all of this stuff.

Rup
  • 33,765
  • 9
  • 83
  • 112