Zuc Stream CipherIn future developments of 3G/4G networks, the Zuc stream cipher is proposed as a standard for "4G" LTE (Long Term Evolution). It was developed by the Chinese Academy of Sciences, but has already been shown to be susceptible to timing attacks. Examples
|
Test
A test of '0000000000000000 0000000000000000' for the key, and IV of '0000000000000000 0000000000000000' should give a key stream of (for the first eight bytes):
Key= 00000000000000000000000000000000 IV= 00000000000000000000000000000000 ----------------------------- ZUC key stream (8 bytes)= 27bede74018082da
A test of 'fffffffffffffff fffffffffffffffff' for the key, and IV of 'ffffffffffffffffffffffffffffffff' should give a key stream of (for the first eight bytes):
Key= ffffffffffffffffffffffffffffffff IV= ffffffffffffffffffffffffffffffff ----------------------------- ZUC key stream (8 bytes)= 0657cfa07096398b
Coding
The following provides some sample code:
import sys from cryptomobile.CM import * import binascii count = 1923412495 bearer = 12 direct = 1 data ='l\xf6S@sUR\xab\x0c\x97R\xfao\x90%\xfe\x0b\xd6u\xd9\x00Xu\xb2\x00\x00\x00\x00' bitlen = 798 k = '2bd6459f82c5b300952c49104881ff48' i = 'ea024714ad5c4d84df1f9b251c0bf45f' key=binascii.a2b_hex(k) iv=binascii.a2b_hex(i) zuc = ZUC() zuc._initialize(key, iv) output=zuc._generate_keystream(8) print "Key= \t",key.encode('hex') print "IV= \t",iv.encode('hex') print "-----------------------------" print "ZUC key stream (8 bytes)=\t",output.encode('hex') output=zuc.EEA3(key, count, bearer, direct, data, bitlen) print "ZUC output stream =\t",output.encode('hex')