Re: Get/Set passwords in Registry without using SetNet32?
Posted in 1998
Topics: Security, Permissions & Auditing
Hello, everybody! I can give some tips for solving this problem. In Informix ClientSDK 2.01 SetNet32 uses function named "EnP" from DLL "iregt07b.dll" to encrypt password. In other versions of client software the name of DLL may be different, but I think it will be "iregt*.dll". The following piece of code shows how to call this function: #include <windows.h> typedef void (f_EnP) (char*); int main() { HMODULE h_IREGT07B; f_EnP* lpf_enp; // Don't know how much to allocate. Maybe UNIX programmers will help. char password[1024]; h_IREGT07B = LoadLibraryA("IREGT07B.DLL"); if (!h_IREGT07B) return -1; lpf_enp = reinterpret_cast<f_EnP*>(GetProcAddress(h_IREGT07B, "EnP")); strcpy(password, "information"); lpf_enp(password); // After this call "password" contains encoded password FreeLibrary(h_IREGT07B); return 0; } Encrypted password, username and AskPassword option are stored under "HKEY_CURRENT_USER\\Software\\Informix\\netrc\\"+<name of host on which Informix server resides> registry. Dirk Gunsthoevel knows how to store values in registry ;). Best regards, Dima