> How does the prosecution prove the plaintext came from defendants' devices?
You show the recovered key and plaintext and demonstrate that they match the ciphertext.
The chance that several gigabytes of encrypted data accidentally happen to decrypt with wrong key to a different several gigabytes of perfectly valid data is rather slim, which means that any key which produces valid data is the key you are looking for.