Why CryptoAPI object is always coming NULL in AX 7 ?

Hi,

I have used CyptoApi for encryption of passwords in AX 2012. The same thing when I tried to implement in AX 7 returns me a null object. I am using the following code in AX 7.

CryptoAPI cryptoAPI;

ContainerClass containerClass;

cryptoAPI = new CryptoAPI(0);

if(!cryptoAPI)

{

throw error("@SYS108972");

}

The control comes to this throw error statement indicating that the cryptoAPI object is null.
Can you please tell me why is that so? How can I encrypt password in AX 7?

Note that this question is already being discussed on another forum.