well i want to encrypt 32bit integers so they are represented by another 32 bit integers
i am currently using des but the resulst is 64bit integer.
so is it possible to have a block cipher with 32 bit block so the output is 32bit integer?
i don't want to use Xor Encryptions as a last resort :)
thanks
views:
136answers:
3you can write all integers into single byte array and encrypt them, another idea is to use 64 bit integers, casting them to 32bit when needed.
This is the only 32-bit block cipher I am aware of: http://www.qualcomm.com.au/PublicationsDocs/skip32.c
For security, 64-bits is generally considered an absolute minimum block size.
To make something like this work securely with common ciphers, you'd can operate a block cipher in a "stream" mode like OFB, CFB, or CTR. This means you need to have a suitable (unpredictable) initialization vector for each integer you are trying to encrypt, or (in CTR mode) have a well-defined message order.
I'm assuming that you want to decrypt the numbers later. If you are just trying to create a pseudo-random generator with a period of 232, there are other techniques you can try.