I am working on an application that requires encryption of video files, which works quite well. But the method that I use for decryption returns the video, as in an array of bytes. Anyway, I can play the video using this array without creating a new file.
Decoding of my method:
private static byte[] decrypt(byte[] raw, byte[] encrypted) throws EncrypterException { SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES"); try { final Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, skeySpec); return cipher.doFinal(encrypted); } catch (Exception e) { throw new EncrypterException(e); } }
Please help me, am I stuck here?
source share