How does data encryption work?
It works like any other encryption, though data has the advantage of being used by/on a machine capable of doing MANY mathematical functions per second. We have come a long way since the days of the Enigma Machine in WWII and the Colossus codebreaking computer at Bletchley Park. Most involve both a key and an algorithm of some sort that tells you to put the key and the data together in a secure fashion. In general, knowing the algorithm does no good if you lack the key and vice-versa. The simplest just add the key and the plaintext (unencrypted data) together. If you know the key and “subtract” it, it is decrypted. Others, like Enigma, are output driven so that the was that a particular letter is encrpyted depends not only on the key but also on the plaintext letter before it. To get much more detailed than that requires you to be more specific as there are many different types of encryption. BTW – you might like to play with this for a few minutes – http://russells.freeshell.org/enigm