1

I am trying to decrypt a string which is encrypted in front end(angualrjs) while calling a rest service in java using angular js. I am able to encrypt the string using $crypto.encrypt ( using CryptoJS).I am passing encrypted value as argument using $http.get method.

But I am not familiar on how to decrypt the value in java.

encryption key in my config:

app.config(['$cryptoProvider', function($cryptoProvider){
       $cryptoProvider.setCryptographyKey('ABCD123');
}]);

Thanks in Advance.

marstran
  • 26,413
  • 5
  • 61
  • 67
arun abraham
  • 147
  • 2
  • 12

1 Answers1

1

Seeing that you're using CryptoJS, there is already an answer posted.

How to decrypt an encrypted AES-256 string from CryptoJS using Java?

However, if you're using SSL/TLS, this encryption is not very effective. Because, even as the password is sent encrypted, there is need to store the password in clear text on the server-side for this purpose - which is not advisable. It is better to securely hash your passwords for authentication.

Community
  • 1
  • 1
Penman
  • 163
  • 3
  • 14