The Vignere cipher is "related" to the Caesar cipher, but because it uses a number of substitutions (2), it is technically a "POLYALPHABETIC Cipher.
The "key" is a phrase that both the sender and receiver knows.
The "Tableau" (2 character lookup table) that a Vignere cipher uses can be envisaged as follows:
As keylength goes up, the possible number of possible substitutions needed to be brute-force tried skyrockets:
stolen from Tutorials Point
Original: "'.$clearText. '"
Key: "'.$key.'"
Ciphertext: "' . $cryptText.'"
#Thanks Greg Egan for the Pseud starter BEGIN SET cryptText='' SET keyIndex = 0 SET alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' INPUT mode INPUT upcase(message) INPUT upcase(key) keyLength = length of key FOR each char in message: IF char not in alphabet THEN cryptText += char ELSE letterPos = position of char in alphabet keyChar = key[keyIndex] keyPos = position of keyChar in alphabet IF mode = 'encrypt' THEN newIndex = (letterPos + keyPos) mod 26 ELSE newIndex = (letterPos - keyPos) mod 26 ENDIF keyIndex = (keyIndex + 1) % keyLength cryptText += alphabet[newIndex] ENDIF ENDFOR PRINT cryptText END