AndroidVideoCache icon indicating copy to clipboard operation
AndroidVideoCache copied to clipboard

Media is encrypted but not working after cached.

Open m7mdra opened this issue 7 years ago • 2 comments

Hi,

Following up on this issue I wrote the Cipher using XOR encryption as you said above, but i ran into problem where data is ciphered successfully and cached but not when i try to decipher the cached file.

private fun encryptOrDecrypt(input: ByteArray, key: String) {
    for (i in input.indices) {
        val o = input[i] xor '0'.toByte()
        input[i] = o

    }
}

and i aslo added the CipherAwareCacheWrapper

  private HttpProxyCache newHttpProxyCache() throws ProxyCacheException {
        HttpUrlSource source = new HttpUrlSource(url, config.sourceInfoStorage, config.headerInjector);
        FileCache cache = new FileCache(config.generateCacheFile(url), config.diskUsage);
        CipherAwareCacheWrapper cipherAwareCacheWrapper = new CipherAwareCacheWrapper(cache, config.cipher);
        HttpProxyCache httpProxyCache = new HttpProxyCache(source, cipherAwareCacheWrapper);
        httpProxyCache.registerCacheListener(uiCacheListener);
        return httpProxyCache;
    }

Can you please guide me on what I'm missing up? Thanks in advance.

m7mdra avatar Nov 23 '18 21:11 m7mdra

@m7mdra Did you fix this & made it work?

AnirudhLoya avatar May 27 '19 06:05 AnirudhLoya

@m7mdra Did you fix this & made it work?

sadly no, but i ended up caching data to local app storage, which is not entirely secure but it met our requirement.

m7mdra avatar Jun 01 '19 08:06 m7mdra