The example cipher Phil Zimmermann cited:
A simple pseudorandom number stream was added to the plaintext stream to create ciphertext.
is easily thwarted. Some asked why. Here is why:
Step 1, feed the cipher plaintext of all 0's. Since 0 added to any number is same as the number un-changed, it completely exposes the pseudorandom number stream in the output.
Step 2, given what you discover in step 1, and given the encrypted text of a secret message, you can easily calculate the original text by simple subtraction of the pseudo random number stream which you now know.
With that said, I disagree with the general notion that inventing your own cipher is almost bad. Any cipher algorithm, upon first creation, has a status of UNKNOWN security strength, even those created by experts. The experts have the advantage of being able to immediately apply typical known attacks and see how the new cipher stands, and be able to quickly rule out some inventions as weak, and amateurs do not have that ability. But it does not necessarily mean the cipher is weak. It means the strength is unknown and it may well be a very strong cipher. You just do not known.
For example I am not an expert. Here is a trivial cipher that I came up in 5 seconds without much thought:
- Pick a random number of 128 bits as your key.
- circular Rotate the key by X number of bits, Call the result value A.
- Circular rotate the key by Y number of bits, split it into two 64 bit parts and multiply them to produce a value B.
- XOR value A and B to produce a new key, use only bit 0 to bit N-1 of this key to encrypt N bit of plain text by XORing.
- Go back and repeat steps 2,3,4.
This seems to be simple enough, and I have not done any analysis to see how strong it is. But all I can say is this has an unknown security strength. It may well be very strong. If you immediately jump into conclusion to say it is weak or unreliable, I challenge you to come up with a method to crack it. Can you?
I think when it comes to security strength, there are only two:
- Unknown security strength
- Known weak security strength
There is no such thing as known strong security strength. If the scheme has been scrutinized a lot without finding a crack, it only means no crack has been found yet and the status remains to be unknown, and it does not necessarily mean strong, because a crack may well be discovered tomorrow.