Created
June 26, 2019 08:58
-
-
Save BDOMDev/80924c283eecafc373b2a5ec651c6d79 to your computer and use it in GitHub Desktop.
Revisions
-
BDOMDev created this gist
Jun 26, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ @Throws(Exception::class) fun decrypt(yourKey: SecretKey, fileData: ByteArray): ByteArray { val decrypted: ByteArray val cipher = Cipher.getInstance("AES", "BC") cipher.init(Cipher.DECRYPT_MODE, yourKey, IvParameterSpec(ByteArray(cipher.blockSize))) decrypted = cipher.doFinal(fileData) return decrypted }