AES decryption error in java -


I am working on AES algorithms and I get this exception:

  javax .crypto BadPaddingException: It com.sun.crypto.provider.SunJCE_f.b Given the com.sun.crypto.provider.SunJCE_f.b last block right on com.sun.crypto (DashoA13 * ..) not padded (DashoA13 * ..) .provider.AESCipher.engineDoFinal (DashoA13 * ..) javax.crypto.Cipher.doFinal (DashoA13 * on org.enterprisepower.io.MyEncryptTools.decrypt ..) (MyEncryptTools.java:41) org.enterprisepower.io but but. IOUtils.copyStream org.enterprisepower.net.portforward.Processor $ Copier.run (Processor.java:99) to (IOUtils.java:132) (unknown source java.lang.Thread.run)   

encrypt messages in myClient program exception decryption and cipherMessage recieve MYSERVER program.After server is cipherMessage send throws exception above, but the customer I can decrypt the same cipherMessage are part.I. (I check it with the bytes printing on both sides ...)

This is my code again:

  // This is both client and server public byte [] The decrypt method for decrypt (byte [] encrypted data, full length) throws an exception {key = generate;); Cipher c = cipher Get Instances (LGO); C.init (cipher DECRYPT_MODE, key); Byte [] ENF = new byte [length]; For (int i = 0; i   

I should mention that I use an array of 117 bytes for an array of 172 for encrypting and decrypting.

Use superb sifirenputstream and forget about the buffers length.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -