cancel
Showing results for 
Search instead for 
Did you mean: 

Password in encripted format for sql database in connection string

SOLVED
Occasional Contributor

Password in encripted format for sql database in connection string

Hi,

 

I am having connection string for my SQL server where in which i need to enter plain password for connction through database.Is there any way so that i can hide or display that password in encripted format.Below is my connection string code :-

 

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=aaa";

 

This password aaa should be in encripted format.

 

Regards,

Naveen

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Password in encripted format for sql database in connection string

Sure... my intention was in script.  So, what you would do is something like this.

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
4 REPLIES 4
Community Hero

Re: Password in encripted format for sql database in connection string

You can store the password in a persistant project variable specifically for a password and then pass in the Decrypted value as a string to that connection string without having to have it open in plain text.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: Password in encripted format for sql database in connection string

Hi ,

 

I want it through script if we have any approach for that.

 

Regards,

Naveen..

Community Hero

Re: Password in encripted format for sql database in connection string

Sure... my intention was in script.  So, what you would do is something like this.

var ConnectionString = "DRIVER=SQL Server;SERVER=H_kptest;UID=aaa;PWD=" + Project.Variables.password.DecryptedValue;

Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: Password in encripted format for sql database in connection string

Thanks,

This line of code solves my problem.

 

Regards,

Naveen...

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors