4 ms·
The more "politically correct" way to encrypt something would be to do it without using encryption. http://people.csail.mit.edu/rivest/Chaffing.txt http://peop
by dchest 14y ago
The more "politically correct" way to encrypt something would be to do it without using encryption.
http://people.csail.mit.edu/rivest/Chaffing.txt http://people.csail.mit.edu/rivest/Chaffing.txt
Basically, use message authentication algorithm with shared secret to authenticate correct message bits and their position, and output random values for incorrect message bits.
For example, to encrypt 2-bit message '10':
1: (1, 2388) -- '2388' is a correct MAC(key, 1||1)
1: (0, 3777) -- '3777' is a random number
2: (1, 9796) -- '9796' is a random number
2: (0, 4786) -- '4786' is a correct MAC(key, 2||0)
Your full message is transmitted as plain text bits + authentication tag, intermixed with opposite bits + random data. Someone not knowing the secret key cannot guess which bits are the correct message bits, and which are incorrect.
To "decrypt", the receiver just calculates authentication tags with the same key, and keeps those bits that correctly authenticate, discarding the ones that don't authenticate.
The easiest to memorize and implement MAC, I think, is SipHash which uses 128-bit keys and outputs 64-bit tags: https://131002.net/siphash/ https://131002.net/siphash/