Lately, I've been looking into cryptography, and I'm seeing if I can make a fun, maybe half-decent symetrical encryption alorithm. I am no professional, I've just seen a few algorithms online. I've came up with a few ideas:
Version 1) I started of with simple xor encryption. I've learned that xoring the cyphertext with the plaintext will give me the key. So to combat this why not subtract the text from the key first? example:
text: 10010110 10111110 10101101
key: 01110001 10101111 10000111
-------------------------------------------------
sub: 00100101 00001111 00100110
then:
sub: 00100101 00001111 00100110
key: 01110001 10101111 10000111
--------------------------------------------------
xor: 01010100 10100000 10100001
Question 1: Is this easily reversable?
Version 2) Then I thought that it might be more secure to do the subtracting stage in (2 bytes, 16 bits) rather than in (1 byte, 8 bits) like above.
Question 2: Is this more secure? Would it provide even better security if I used (4 bytes, 32 bits) on the subtraction stage?
Version 3) Lastly I thought that maybe I could expand the key, so it looks like the key is random (assumung the origonal key was truly random) and is the same size as the text. Something like below maybe?
1. Load the key into two variables: first key and second key.
2. Encrypt a keylength of text with the first key.
3. Rotate the first key 5 bits left.
4. Use version 2 (or 1, if the security is the same) on both keys, store on second key.
5. Encrypt the next keylength of text with the second key.
6. Rotate the second key 5 bits right.
7. Loop all but the first step until there is no more text.
I remeber seeing some kind of key expanding algorithm in rijndael I think.
Question 3) Is this anymore secure? That was just a last minute algorithm, but if you get another good key expanding formula, would the security be better?