Joint encryption and error correction schemes