Planning Analytics

 View Only

Ever needed to recover a TM1 user's password when using native security i.e. mode 1?

By George Tonkin posted Fri March 31, 2023 11:56 PM

  

Ever needed to recover a TM1 user's password when using native security i.e. mode 1?

The below script uses some undocumented functions to do the decryption.
These are not recognized in PAW but save and just ignore the error or use Architect.

Create a new process with a string parameter called pClient then add the following to the prolog section:

IF(pClient@='');
  pClient=TM1User;
ENDIF;

sKey='}@BujrF]uxPmWkqw}&t]MeOwNOx{tvYO,eD';
sPassword='';
sCipher=CellGetS('}ClientProperties', pClient, 'PASSWORD');
sCipher=EncodePassword(sCipher);
sModifier=INT(LOG(Long(sCipher)+1))-2;
sModifier=IF(sModifier<0, 2, 0);

nIndex=Long(sKey);
While(nIndex>2);
  If(Mod(nIndex-sModifier,3)=0);
    sCharacter=SUBST(sKey,nIndex-2,1);
    nCode=CODEW(sCharacter,1);
    sCharacter=CHAR( nCode- INT(nIndex/3));
    sPassword=sCharacter | sPassword;
  
  Endif;
nIndex=nIndex-1;
End;

TextOutput('password.txt',pClient, sCipher, sPassword);


Save and run the process, giving it a valid client or leave blank for your user.
After the run completes, view the password.txt file located in your data folder for the result.

#ibmchampions-highlights-home #ibmchampions-highlights 

1 comment
202 views

Permalink

Comments

Thu April 13, 2023 02:41 AM

Hello George, 

I gave it a try yesterday, did not even have a result remotely close to a password, not even the right number of characters. 

I'm wondering how this EncodePassword function works, and what is this key you are using ? 

I was thinking it might come from the encryption keys the server is using or codepage issues but my guess is that it should not be an issue at all since the applications are portable from a version to another. I'm puzzled.

Cheers, 
Laurent