My problem is the following:
In an existing database I want to encrypt data in a couple of columns. The columns contains strings of different lengths.
I don\
The Vigenère cipher can do that. But it is old (pre-computer) and only secure if your key phrase is longer than the longest string you want to encrypt. Plus, having a database full of strings encrypted with the same key phrase will probably make this a week encryption, especially if the plain texts can be guessed.
It works more or less like the cesar shift algorithm (add n to each letter in plain text), except that n is different for each letter being changed, based on a key phrase.
If your key phrase is ABCDEFG, then it means n=1 for first letter of input, 2 for second letter of input etc.
With a random key phrase longer than the plain text, the output is just as random (secure). But I believe this will break down if you have many strings encrypted with the same key. ..