Tags: radio 

Rating: 0

Original writeup has images and description of method.

## Solution script

```python
import wavio, fpylll, bitarray, numpy

def reduceLattice(lattice):
A = fpylll.IntegerMatrix.from_matrix(lattice)
M = fpylll.GSO.Mat(A)
M.update_gso()
L = fpylll.LLL.Reduction(M)
L()
return numpy.array(map(list, A), dtype=int)

wav = wavio.read('CDMA_interception.wav')

# Compute mean values for every time slot
means = wav.data.reshape((wav.data.size/100,100)).mean(axis=1)

# Convert mean values to integers and reshape into matrix of data
matrix = (means.reshape((means.size/32,32))/7500.0).round().astype(int)

# Get reduced basis for matrix through lattice reduction
base = reduceLattice(matrix)[:8]

# Compute raw data through dot product with basis
rawdata = base.dot(matrix.transpose())

# Reduce raw data more, as base is not perfect
data = reduceLattice(rawdata)

# To through all 8 data streams and print flag if found
for d in data:
plaintext = bitarray.bitarray(list(d<0),endian='big').tobytes()
if 'INSA' in plaintext:
print plaintext
```