I am trying to Encrypt some Data received via a BLE peripheral device, but there seems to be no "nopadding" option, below is my code so far, but I am actually converting parts of swift code project i have working.
AES Encryption:
Public Sub AESEncrypt(dataToEncrypt() As Byte, MyAESPW As String) As Byte()
Dim md As MessageDigest
Dim C As Cipher
Dim bMD() As Byte = md.GetMessageDigest(MyAESPW.GetBytes("UTF8"),"MD5")
Dim iOption As Int = Bit.Or(C.OPTION_PKCS7Padding,C.OPTION_ECBMode)
Dim bData() As Byte = C.Encrypt2(dataToEncrypt,bMD,"AES",Null,iOption)
Log("data size: " & bData.Length)
Return bData
End Sub