java - Decoding media file in chunks with AES 128 in CTR mode -
i have mp3 file encoded , saved locally on device. in order play file need decode in chunks not greater 515b aes 128 in ctr mode on fly. have iv every file in hex. file played using jwplayer. have 2 problems:
problem 1: first of trying decode file whole test purposes.
final string algorithm = "aes"; final string transformation = "aes/ctr/pkcs5padding"; final byte[] iv = trackiv.getbytes(); secretkeyspec secretkey = new secretkeyspec(key, algorithm); cipher = cipher.getinstance(transformation); cipher.init(cipher.decrypt_mode, secretkey, new ivparameterspec(iv)); the iv hex iv getbytes() from. receiving:
com.android.org.bouncycastle.jcajce.provider.symmetric.util.baseblockcipher$1: ctr/sic mode requires iv no greater than: 16 bytes. my iv 32 bytes long. doing wrong?
problem 2: how should approach streaming file in chunks? there dedicated classes handle me? grateful advice me started.
Comments
Post a Comment