Hi,
I'm trying to encrypt an inputstream to an outputstream using @DonManfred 's library, but I 'm not sure how to do it.
Returns: java.lang.IllegalArgumentException: Streaming encryption does not support authenticated encryption
As I found (https://github.com/rockaport/alice) should set MacAlgorithm to NONE, so I tried:
Which returns: java.lang.IllegalArgumentException: No enum constant com.rockaport.alice.AliceContext.MacAlgorithm.None
I'm stuck now.
Another question: Is this way of encryption (and later: decryption) fast enough for large files/streams ?
Thanks
I'm trying to encrypt an inputstream to an outputstream using @DonManfred 's library, but I 'm not sure how to do it.
B4X:
Dim inp As InputStream = File.OpenInput("c:\temp", "inputFile.mp4")
Dim outp As OutputStream = File.OpenOutput("c:\temp", "outputFile.mp4", False)
Dim bc As ByteConverter
Dim pwd() As Char = bc.CharsFromBytes(bc.StringToBytes("FGERHZXCG434TRWR", "ASCII"))
Dim alice As Alice
Dim ac As AliceConstants
Dim bld As AliceContextBuilder
bld.Initialize("")
bld.Algorithm = ac.AES
bld.Mode = ac.CTR
alice.Initialize("Alice",bld.build)
alice.encryptStream(inp, outp, pwd)
Returns: java.lang.IllegalArgumentException: Streaming encryption does not support authenticated encryption
As I found (https://github.com/rockaport/alice) should set MacAlgorithm to NONE, so I tried:
B4X:
Dim inp As InputStream = File.OpenInput("c:\temp", "inputFile.mp4")
Dim outp As OutputStream = File.OpenOutput("c:\temp", "outputFile.mp4", False)
Dim bc As ByteConverter
Dim pwd() As Char = bc.CharsFromBytes(bc.StringToBytes("FGERHZXCG434TRWR", "ASCII"))
Dim alice As Alice
Dim ac As AliceConstants
Dim bld As AliceContextBuilder
bld.Initialize("")
bld.Algorithm = ac.AES
bld.Mode = ac.CTR
bld.MacAlgorithm = ac.MacAlgorithmNONE 'this is the line I added
alice.Initialize("Alice",bld.build)
alice.encryptStream(inp, outp, pwd)
Which returns: java.lang.IllegalArgumentException: No enum constant com.rockaport.alice.AliceContext.MacAlgorithm.None
I'm stuck now.
Another question: Is this way of encryption (and later: decryption) fast enough for large files/streams ?
Thanks