I'm trying to replace a value in an encrypted file. We changed servers, so the new server name needs to be added to the encrypted ini file.
This temporary fix works, but it defeats the purpose of the encrypted file if you enter the data directly into the code:
Public Property Get Server() As String
'Work around
'Server = "PEFSSQL01" ''Hard coded server name change. Change made on 5-11-11
'Original code
Server = DecryptString(msSvrNm, msCrypKey, True)
End Property
This code works (decryptStringCode), it produces the correct result with the hex encryption value given. The correct result is PEFSSQL01. However, when I copy this hex string into the ini file and then run the checkServerName procedure, it does not produce the correct result.
So what I need is to replace the hex string between the <s> </s> tags in the ini file and have the result of the checkServerName equaled to PEFSSQL01.
I've stripped out some of the values in the encrypted file. Attached is the workbook with the class module and regular module where I'm testing. The ini file should be saved in a folder called 'cfg'. The 'cfg' folder should be in the same directory where you save the workbook.
Thanks in advance for the help, I've been trying for a day now to figure this out.
Tracy
Sub decryptStringCode() Dim clsX As cls_Cfg Set clsX = New cls_Cfg '**************************************** 'This produces the result: PEFSSQL01 Debug.Print clsX.DecryptString("EB29DEABBF877B585F6FBB29F987B913545771F67D68C092", "L0c@lKeyKrypt", True) '**************************************** Set clsX = NothingEnd Sub
Sub checkServerName() Dim clsX As cls_Cfg Set clsX = New cls_Cfg MsgBox "Server Name: " & clsX.Server 'Does not show correct result of PEFSSQL01 MsgBox "User Name: " & clsX.User 'Shows correct result Set clsX = NothingEnd Sub
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.
Our community of experts have been thoroughly vetted for their expertise and industry experience.