Skip to content
Advertisement

Encrypt By javascript and decrypt by Java

I use AES encryption in my react-native app as below

JavaScript

Out come= encrypted: aK7+UX24ttBgfTnAndz9aQ==

following is the code I use in my backend using java for get the decrypt

JavaScript

output= decryted : = 123456[][][][][][][][][][]

Iam getting out put as 16 bit as above. what I want is out put should come as only 123456.

Advertisement

Answer

I Suggest you use java.util.Base64 for decoding. The following worked out correctly. I would also suggest using trim in return originalString and see if it works out.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement