Addressables-Sample icon indicating copy to clipboard operation
Addressables-Sample copied to clipboard

Request for basic encryption example

Open VR-Architect opened this issue 5 years ago • 6 comments

Please provide a basic example of implementing some basic level of encryption. Thanks.

VR-Architect avatar Jul 13 '20 12:07 VR-Architect

i agree, this would be very useful to have. Would like to not have to worry about assets being flipped right after launch.

ChetRippo avatar Jul 29 '20 18:07 ChetRippo

In multiple Unite talks the dev mentioned that an encryption example would be available on Github. Yet, I couldn't find them. Has this been abandoned?

renatoi avatar Aug 06 '20 01:08 renatoi

Hi all apologies for the delay! Unfortunately there are no plans to provide an example project demonstrating encryption. There are some limitations such as bundle caching and memory increases that make it not feasible, especially for projects with lots of AssetBundles.

kirstenpilla avatar Jan 14 '22 22:01 kirstenpilla

Hi all apologies for the delay! Unfortunately there are no plans to provide an example project demonstrating encryption. There are some limitations such as bundle caching and memory increases that make it not feasible, especially for projects with lots of AssetBundles.

Can you elaborate a bit more so we can find a solution? Specifically is it NOT possible or does the team not have the bandwidth to provide the sample given some quick prototyping issues being encountered (caching/mem increase you mention).

ghost avatar Mar 27 '22 04:03 ghost

@thomasftg Hi, yes the latter. It is possible to do for projects with a small number of AssetBundles. Due the issues mentioned we are not able to provide an official sample project at this time.

You could create a custom AssetBundleProvider class that extends that base class, and additionally handles the encryption and decryption steps. One way to approach this is to use LZ4 Decryption. An AssetBundle that uses LZ4 compression consists of 256KB chunks that can be encrypted. The bundle can be loaded from a seekable stream (AssetBundle.LoadFromStreamAsync) and individual chunks can be decrypted as they are loaded.

kirstenpilla avatar Mar 28 '22 13:03 kirstenpilla

@thomasftg Hi, yes the latter. It is possible to do for projects with a small number of AssetBundles. Due the issues mentioned we are not able to provide an official sample project at this time.

You could create a custom AssetBundleProvider class that extends that base class, and additionally handles the encryption and decryption steps. One way to approach this is to use LZ4 Decryption. An AssetBundle that uses LZ4 compression consists of 256KB chunks that can be encrypted. The bundle can be loaded from a seekable stream (AssetBundle.LoadFromStreamAsync) and individual chunks can be decrypted as they are loaded.

Hello, thank you for the tips! Which methods can I use to do the encryption and decryption? Can you guide me how the AssetBundleProvider works in order that I can make a cryptography implementation, please? Best regards!

fabiolamin avatar Dec 15 '22 17:12 fabiolamin