Hello I want to encrypt and decrypt an audiostream:
When decrypting i get the following error:
javax.crypto.IllegalBlockSizeException: error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH
On the forum i find a lot o f encryption threads, what is the correct way to do this.
B4X:
Sub Encrypt(CLR() As Byte) As Byte()
Dim c As B4XCipher
Dim bc As ByteConverter
Dim S As String = bc.HexFromBytes(CLR)
Log(S)
Dim Enc() As Byte = c.Encrypt(S.GetBytes("UTF8"),Starter.EncryptionPassword)
Log(Enc.Length)
Return Enc
End Sub
Sub Decrypt(EncryptedData() As Byte) As Byte()
Dim c As B4XCipher
Dim bc As ByteConverter
Dim S As String = bc.HexFromBytes(EncryptedData)
Dim Dec() As Byte = c.Decrypt(S.GetBytes("UTF8"),Starter.EncryptionPassword)
Return Dec
End Sub
When decrypting i get the following error:
javax.crypto.IllegalBlockSizeException: error:1e00007b:Cipher functions:OPENSSL_internal:WRONG_FINAL_BLOCK_LENGTH
On the forum i find a lot o f encryption threads, what is the correct way to do this.