Two main problems: First, the "key" is too short and
so repeats a ton of times on a moderately large file
so you have lots of opportunity to figure out parts of
the key one place and use that knowledge a ton of other
places. Second, you are xoring ASCII characters so it
isn't that hard to recognize patterns.
If I wanted to do something like this I would:
- Compress the clear text first.
- Add a random pre-amble of random length since
the compressed clear text will start with a predictable
signature (see other threads here on how to get
enough randomness).
- Don't use the key directly. Use a MD5 hash of
the key, for example.
- Use the compressed clear text to modify what you
are xoring with as you go.
But I'm not a professional cryptographer and I strongly
suspect that a professional cryptographer would be able
to break such a scheme. You are really better off to go
with a recognized encryption algorythm.
-
tye
(but my friends call me "Tye")
| [reply] |