Encryption algorithms work by turning legible data into unreadable data, this is done by taking some original data usually text and translating its components(individual symbols or words) into new components, “hello world” becomes “world hello” as the absolutely simplest example. Believe it or not encryption existed even before the invention of the computer, infact the first digital computer was built to decrypt nazi messages. Now encryption algorithms are incredibly complex so for your confort and mine I will skip presenting on them and instead discus one of the first encryption algorithms to exist created without computers 27 centuries ago in ancient greece, the scytale. quoted diretly from plutarch:
The dispatch-scroll is of the following character. When the ephors send out an admiral or a general, they make two round pieces of wood exactly alike in length and thickness, so that each corresponds to the other in its dimensions, and keep one themselves, while they give the other to their envoy. These pieces of wood they call scytalae. Whenever, then, they wish to send some secret and important message, they make a scroll of parchment long and narrow, like a leathern strap, and wind it round their scytale, leaving no vacant space thereon, but covering its surface all round with the parchment. After doing this, they write what they wish on the parchment, just as it lies wrapped about the scytale; and when they have written their message, they take the parchment off and send it, without the piece of wood, to the commander. He, when he has received it, cannot otherwise get any meaning out of it,--since the letters have no connection, but are disarranged,--unless he takes his own scytale and winds the strip of parchment about it, so that, when its spiral course is restored perfectly, and that which follows is joined to that which precedes, he reads around the staff, and so discovers the continuity of the message. And the parchment, like the staff, is called scytale, as the thing measured bears the name of the measure.
The ancient greeks where a incredibly inteligent people both in their understanding of philosophy and in the natural sciences, this is evident by their use of base geometric principle to encrypt, forget hash functions, complex numbers and expoentials the greeks two milenia and the better part of a half before our modern day the greeks accomplished things that have never been before nor since seen. I encurage you to try it yourself,