Hi
I can encrypt/decrypt using below link
community.dynamics.com/…/encrypt-decrypt-in-ax-2012.aspx
But I am trying to encrypt and store the value in a table and using that table I want to decrypt the value.
I can see the encryption method returns a container and that container is used to decrypt. I want to get this manually.
If I store the encrypted value in a container manually and try to decrypt it, it doesn’t seem to work.
Any help please.
Regards,
Varry
Can you tell us what you’re doing and what “it doesn’t seem to work” exactly means?
I have got the encrypted value, now I am trying to decrypt it. I stored the encrypted value in a container and used it as a parameter for my decryption code. Where I don’t get any output in the info box(expected the original value before encryption).
Can you please share the decryption code.
thanks
varry
You already have the code in the link above. I don’t see any reason why I should repeat it.
You have a problem with your code, therefore you should show it and explain what you’re trying to achieve and what’s wrong. I can’t help you until then.
Thanks for the replies, I found the solution.
Angelus we have much easier way in the link in above posts
Martin I have created a new class where i have two methods encrypt and decrypt. I have the encrypted value “10e9a1f824d24e12a441a45f7ef5cc17” which I was trying to decrypt by inserting in a container for my decrypt method below. But I found inserting as a sting in a container doesn’t work. So Used
BinData::stringToData(“10e9a1f824d24e12a441a45f7ef5cc17”);—returns a container Which I used below to decrypt.
public str decrypt(container conEncrypted)
{
str value;
container decryptValue;
;
cryptoAPI = new cryptoAPI(99999999999);
decryptValue = ContainerClass::blob2Container(cryptoAPI.decrypt(conEncrypted));
value = con2str(decryptValue);
return value;
}
Regards,
Varry