Encryption module error

1
Hi,   I am using the encryption module to send emails when registering users in the application. When I do it on localhost I don't have any problem, but when I try to do it in production an error appears in the java action Encryption.DecryptString.   The error that appears is the following:   11:15:43APPERROREncryption: Error while decrypting string: Cannot decrypt the text because it was either encrypted with a different key or not encrypted at all 11:15:43APPat com.mendix.webui.requesthandling.helpers.ContextHandling.inContext(ContextHandling.scala:29) 11:15:43APPERRORConnector: An error has occurred while handling the request. [User 'Anonymous_1d33c338-2061-44da-adff-9321a1079229' with session id '0fdb8680-XXXX-XXXX-XXXX-XXXXXXXXf73f' and roles 'Anonimo'] 11:15:43APPcom.mendix.webui.WebUIException: Exception while executing runtime operation 11:15:43APPat com.mendix.webui.actions.client.RuntimeOperationAction.$anonfun$apply$1(RuntimeOperationAction.scala:60) 11:15:43APPCaused by: com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: Cannot decrypt the text because it was either encrypted with a different key or not encrypted at all I have downloaded the latest version of the encryption and the same thing is still happening. I can't find where the error could be.   Thanks
asked
2 answers
2

The use case of the encryption module is to change a value so that it is not directly readable in f.e. the database. For that you are changing the value you are storing by encrypting it. You do this with a key. You can see this key as a password to get the original value back. By entering the encrypted value together with the key (password) you can get the original value again.

 

What your error message is stating is that your key is incorrect from when your value was originally encrypted, or your original value didn't have any encryption at all.

 

So there is a mismatch there, that either you changed the key, or the value was originally not encrypted at all.

 

Please be aware if you used to use an older version of the encryption module it first used a 16character key, but nowadays uses a 32char key.

This might cause the problem if you upgraded.

answered
0

Hi, Mikel Castro,

 

Kindly update the Community Commons module and the encryption key module and trigger the mail. I hope this will work. I also faced this issue in one of my colleagues's projects. I just updated the community commons because, in that, only we have the encrypt and decrypt functions.

answered