| ▲ | 201984 2 hours ago | ||||||||||||||||
In the context of encrypting 32 or 64 bit IDs, where there is no nonce, that'd be equivalent to XOR encryption and much weaker than TFA's small block ciphers. | |||||||||||||||||
| ▲ | adrian_b an hour ago | parent | next [-] | ||||||||||||||||
If you really want to encrypt and decrypt 32-bit numbers without having any nonces available, the fastest way on non-microcontroller CPUs remains using the AES instructions. You can exploit the fact that the core of AES consists of 32-bit invertible mixing functions. In order to extend AES to 128-bit, a byte permutation is used, which mixes the bytes of the 32-bit words. The AES instructions are such, that you can cancel the byte permutation. In this case, you can use the AES instructions to encrypt separately four 32-bit words, instead of one 128-bit block. Similarly by canceling the standard byte permutation and replacing it with separate permutations on the 2 halves, you can make the AES instructions independently encrypt two 64-bit words. These AES modifications remain faster than any software cipher. How to cancel the internal permutation and replace it with external shuffle instructions was already described in the Intel white paper published in 2010, at the launch of Westmere, the first CPU with AES instructions. | |||||||||||||||||
| |||||||||||||||||
| ▲ | fluoridation an hour ago | parent | prev [-] | ||||||||||||||||
Would it, though? Either way you're operating in ECB mode with 2^32 or 2^64 values. Why is one more secure than the other? EDIT: What I mean is you can do cypher = truncate(plain ^ AES(zero_extend(plain))). | |||||||||||||||||
| |||||||||||||||||