You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the clean code. However, when I tries to run it, it has a problem. It works beautifully when encrypt/decrypt with the same language (encrypt with php, then decrypt with php, or encrypt with Java, then decrypt with Java). But when I tried to encrypt a string, then try to decrypt with Java, it does not work. For example, encrypt the string "123456789" in php gives "xclAYNWIbzt6bZ1ewhdEjQ==". Encrypt the same string "123456789" in Java gives "udpnHfeBRTsrcKwzAs5law==". when trying to decrypt the php encrypted string, I got an Java BadPaddingException error:
javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
at javax.crypto.Cipher.doFinal(Cipher.java:2087)
at Main.decryptStr(Main.java:544)
at Main.main(Main.java:135)
The text was updated successfully, but these errors were encountered:
Thanks for the clean code. However, when I tries to run it, it has a problem. It works beautifully when encrypt/decrypt with the same language (encrypt with php, then decrypt with php, or encrypt with Java, then decrypt with Java). But when I tried to encrypt a string, then try to decrypt with Java, it does not work. For example, encrypt the string "123456789" in php gives "xclAYNWIbzt6bZ1ewhdEjQ==". Encrypt the same string "123456789" in Java gives "udpnHfeBRTsrcKwzAs5law==". when trying to decrypt the php encrypted string, I got an Java BadPaddingException error:
javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:811)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:676)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:313)
at javax.crypto.Cipher.doFinal(Cipher.java:2087)
at Main.decryptStr(Main.java:544)
at Main.main(Main.java:135)
The text was updated successfully, but these errors were encountered: