I am looking for a simple and FAST algorithm to encrypt/decrypt a string (length is about 128 bytes) with a password.
Any good algorithms?
ADDED: Custom algorithm is absolutely OK. Less memory it take – better it is (for my case). No extra classes – perfect.
Here is a simple encryption/decryption method. It is pretty weak, so I present it for, say education purpose:
It simply xors the bytes of a phrase with the bytes of a password. The same method can be used to encrypt and decrypt. Not a big challenge for a crypto analyst, by the way, but an easy start if you just need to obfuscate some data.
To make it a slightly better: don’t pass a password String but a byte array with random values. But you wanted a method with a password, that’s why I’ve implemented it that way 😉