Search code examples
swiftencryptionvideo-streaminggoogle-cloud-storageaes

Google Cloud Storage stream aes encrypted video to iOS


I'd like to stream a AES encrypted video file wich is stored on google cloud storage to a iOS device. One important point to mention here is that the decryption has to take place on the device.

Are some AES cyphers not suitable for that ? Should I use some VM on the backend that handles the streaming part ?


Solution

  • You could use Secure Real-Time Streaming Protocol (RTSP), using TLS, providing a secure channel via ephermeral:ephemeral ECDH.

    AES in a streaming mode is suitable too, should you be happy to manage symmetric keys separately. Suggest AES-GCM with 96-bit nonce. Remember to be aware of data limits of said counter mode. Additionally, remember the nonce, keypair tuple also have limits on usage, rotate the key appropriately (assuming random nonce per message).

    Recommend libsodium bindings in Swift (SwiftSodium) for the above.