An easy function is ROT-13 which means rotate by 13. Replace each letter by the one 13 places beyond. After Z wrap around to A. Thus A is replaced by N, B by O, C by P, ... N by A, O by B, P by C etc. Perform ROT-13 twice and you get back the original message. No key is used. ROT-13 is used to obscure answers to puzzles. But it provides zero security since many people can read it in a flash.
A very sophisticated system of the type you seek was the German Enigma. That was broken by the British during WWII.