The roDeviceCrypto component enables you to encrypt and decrypt data on a device using a key that is unique per channel, device, or model. Using a channel key for example, you can encrypt data for a channel so that it may only be decrypted by that same channel. In this case, you could provision credentials or an API key from the cloud to devices securely. With a device key for example, you could implement a secure-storage like algorithm.
roDeviceCrypto has two methods: Encrypt() and Decrypt(). Both methods take a roByteArray and the encryption key type (encType), which is a string that may be set to "channel", "device'", or "model". Both methods return a roByteArray so that you can encrypt plaintext on a Roku device and then decode it, as demonstrated in the following example: