Creating my own Encryption
I am going to create my own encryption, and I was wondering if any of you guys have some advice, or maybe one of you guys made your own encryption and you might have some useful tips on what to, and what not to do?
I was thinking of a CBC bases encryption (Cipher Block Chaining). and I am going to code the encryption/decryption program in C++.
any suggestion or advices are gladly appreciated.
EDIT: if you know any good literature / articles / e-books/ whatever, just post them
-CL-
PS. yes I know you don't just create an encryption in a week, I am willing to spend a year or more on it if necessary
EDIT: by the way: I am not doing this alone
EDIT: just noticed that stupid me put this topic in the wrong place… sorry about that…
How about creating the text you want to decrypt with 12 passwords. All passwords are relative to each other, and when entered all twelve they will produce a message. If someone enters a wrong pass, the text at the end becomes trash. This way nothing of interest can be viewed in the source. Brute forcing 12 passwords (with 12 chars each?) takes a long time. The only problem is writing an algorithm for this..
you get that? :P
Like mr_noob said it's a good idea that your algorythm start by taking all caracter and coverting them into there ascii value so that Âyou can easily use them. After that you can make it like you want. What's also great is that the output of your encryption should always have the same amout of caracter like md5 and sha1.
spyware wrote: How about creating the text you want to decrypt with 12 passwords. All passwords are relative to each other, and when entered all twelve they will produce a message. If someone enters a wrong pass, the text at the end becomes trash. This way nothing of interest can be viewed in the source. Brute forcing 12 passwords (with 12 chars each?) takes a long time. The only problem is writing an algorithm for this..
you get that? :P
that would be very f*cked up to remember, if you have 3 differently encrypted files you would have to remember 36 passwords…
and i want it to be able to encrypt anything, not just text….
and finally; CBC also gives every block a different encryption, only with only 1 pass + an IV
EDIT: PS. good luck with your exams tomorrow spyware, I'll see you at school :P
@arto :
i want the encryption to be reversible, thats why im going for CBC and if the output always has the same length this is gonna be impossible
@ mister noob
already thought of that, just need to figure out what the best way to code the algorithms etc is
I think you understand that anything you produce will not likely be the best option available for you. There's plenty of freeware. That being said, I think this is a great opportunity to learn.
This is one of the only places I'd really recommend learning asm, and learning about compiler workings. At some point, you're going to want to know exactly how your c++ translates into bits and bytes, at least if you want it to be fast and secure.
Gathered this from wikipedia: In the cipher-block chaining (CBC) mode, each block of plaintext is XORed with the previous ciphertext block before being encrypted. This way, each ciphertext block is dependent on all plaintext blocks processed up to that point. Also, to make each message unique, an initialization vector must be used in the first block
and this from network sorcery: Some commonly used block cipher algorithms are IDEA, RC2, RC5, CAST and Skipjack.
so pretty much, you divide the plaintext into chunks of say 128b, XOR the first chunk with some randomness(Initialization vector, kinda part of the key), encrypt it with one of the above algorithms (using the rest of the key), and then use the result as the initialization vector in the next round.
As for implementing one of the above algorithms without using the standard library, or for writing your own block cipher, that's way over my head.
I may be indiscreet but I have to ask you: Why are you not using AES ?
At least, read about AES, see how it works and start your work based on that algorithm. I think that AES is an example of simplicity and could be easily extended.
But, first, define your goals: strength, speed, simplicity and so on.
Or, if you want more, take a look at public key encryption algorithms.