Encryption & Decryption in Ax 2012

Hi All,

I have written two seperate methods for both Encrypt & Decrypt.

Encryption is going on correctly, and then storing the encrypted value in a string field in a Table.

But for decrypting, I have written this piece of code mentioned below:

CryptoApi cryptoApi = new CryptoApi(99999);

Container cont;

container cont1;

Password password;

Tablename tableName;

cont1 = conIns(cont1, 1, BinData::stringToData(tableName::find().UserPassword));

if (!cont1)

{

return ‘’;

}

cont = ContainerClass::blob2Container(CryptoApi.decrypt(tinCont));

return con2Str(cont);

but seems like it is not working properly and thorwing error “Problem in Encrypt and Decrypt”.

Please guide me on this problem

I am using Ax 2012 version.

Thanks

Pranav Gupta

Hi All,

Finally get the solution.

Now instead of storing the encrypted value in a string field, I am directly storing it in the container type field.

Now the decryption functionality is working properly.

Thanks & Regards

Pranav Gupta