Tuesday, August 7, 2007

Encryption and Decryption in AX

Encryption and Decryption in Axapta

TextBuffer textBuffer = new TextBuffer();
;

textBuffer.setText(_text);
textBuffer.encrypt(987654123); // Basic encryption

To decrypt the string again, use the following code:
TextBuffer textBuffer = new TextBuffer();
;

textBuffer.setText(_text);
textBuffer.decrypt(987654123);
decryptedString = textBuffer.getText();