Issue I am trying to encrypt a video clip using dart. I have tested this java code https://stackoverflow.com/a/9496626/8511016 and would like to do the same but using dart. Solution Here is the solution that I found. Hope it helps. Remember
Continue readingTag: encryption
AES128 produces result longer than 16 bytes in Flutter Encrypt package
Issue I am working on a flutter project where we need to encrypt a plaintext that is given in hex with a key that is also given in hex. We’re using a package called encrypt which only accepts plaintext as
Continue readingPlain text encrypt from Dart code but decrypt from Java code
Issue When I encrypt plain text using Dart,and encrypted text is decrypted from Java code, I get this error: javax.crypto.BadPaddingException: pad block corrupted at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.doFinal(Unknown Source) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) at javax.crypto.Cipher.doFinal(Cipher.java:2168) at AesUtil.doFinal(AesUtil.java:75) at AesUtil.decrypt(AesUtil.java:60) at Main.main(Main.java:18) Same IV, salt
Continue readingAES/GCM encryption on Android (Java), 'or' Kotlin statement equivalent in Java
Issue I’m trying to implement encryption in my app. I found some Kotlin code on GitHub and tutorials on how to implement it, until I found this block: val kgps = KeyGenParameterSpec.Builder("my_aes_key", KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_GCM) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) // This is
Continue readingDecrypt Modulr secure token
Issue In my Flutter App I need to decrypt a secure token from the Modulr API. First I need to generate a RSA key and Modulr will use it to generate a secure token. When the token is generated I
Continue readingHow to generate 256-AES CBC key with PKCS5 padding key in Dart
Issue I need to figure out how to generate a random 256 AES CBC key with PKCS5 padding in Dart for my Flutter project. I’ve been able to accomplish it in Java using this: public static SecretKey generateSecretKey() { KeyGenerator
Continue readingECDH key agreement generated Key Pair is always invalid in Android 12
Issue I’ve written the below code following the official guide for ECDH Key Agreement on Android. private static final String EC_SPEC = "p-256"; private static final String KEY_PAIR_NAME = "abcdefgh"; private static final String MAC_ALG = "HMACSHA256"; private static final
Continue readingIs it possible to set the set cipher suite for a TLS connection when using TLSv1.3?
Issue I am developing an application where I am setting up a TLS connection between two devices. I am using TLSv1.3, but when I try to set the cipher suite like this: String[] protocolCHACHA = new String[1]; protocolCHACHA[0]= "TLS_CHACHA20_POLY1305_SHA256"; String
Continue readingHow to upload encrypted image file on google drive from android using Google Drive API
Issue I want to upload the encrypted image file from Android to a user-specific google drive, Also want to Decrypt the image while loading in-app. Solution Use the following function It will upload encrypted image file on google drive and
Continue readingRSA Encryption on Flutter and Decryption in Python
Issue I am currently working on my first Flutter project and I would like to explain the situation first: I am writing a Python Api using Flask which creates an RSA key pair as follows and stores them into files:
Continue reading