How to Encrypt and Decrypt Connection Strings in .Net app.config and web.config Files

preview_player
Показать описание

Encrypting the connection information will make it unreadable. This adds some security to your deployment, as it can stop people from getting valuable credential information. It remains unreadable until someone decrypts it, but measures can be implemented to make this very difficult unless a user has certain permissions on a folder.

Get Microsoft Office including Access:

Got a YouTube Channel? I use TubeBuddy, it is awesome. Give it a try:


For developers looking for a new role, check out:

Want my team to do a project for you? Let's get to it!

Need help on an ETL Project? Contact me today!

#dataengineering #encryptconnectionstring

Рекомендации по теме
Комментарии
Автор

Really great knowledge sharing . Thank you Sir

prakashkhedkar
Автор

Just to say, this is a great video buddy well done, it really helped me a lot!

TheNitrome
Автор

Yea man! You are awesome... Looking forward to learning more from you.

MuhammadAhmed-pdzu
Автор

This was really helpful for me! Thanks so much.

TubeDude
Автор

Thank you,
Thank you,
Thank you

cumdomino
Автор

Thank you for this! It is very helpful.

CalorieCountingCentral
Автор

I have a curious question about this that I haven't been able to find addressed anywhere, maybe you can provide some insight:
My understanding of this encryption mechanism is that it uses encryption keys that are part of the physical hardware of the computer. This is why transferring the exe and config file to a different computer will not help. But what about Virtual Machines? I have just deployed an app that uses this method on a program running on an Amazon EC2 instance. I encrypted the config file once and then every time my program runs, it automatically decrypts it. EC2 instances boot up on different hardware every time they run. In addition, I've created an Amazon Image of my EC2 instance so that I can have many more running instances of this image, all of which will run on different hardware. Yet the decryption of the config file that I encrypted on the original machine still works on all the various instances! If the encryption is based on the specific hardware of the machine where it was encrypted, this shouldn't be possible.
So what is going on here?

TubeDude
Автор

What should you do if you need multiple clients on different machines to use one (centrally managed) encrypted connection string?

DH-rtwl
Автор

I have a web-application hosted on Azure cloud. Can I encrypt and decrypt it in my webconfig file itself

datadecoder_sai
Автор

But how to take benefit of this way for desktop or mobile applications since the encrypted connection string cannot be decrypted on any other computers?

omarsebakhi
Автор

i use dotnetpeek to detect to detect your method decrypt code so how would we handle this because i copy your decrypt method and then got your db connection again

กิตติอัคควัฒนกุล
Автор

Sean, great video. Please would you provide a video using

mrplatypus
Автор

Is this the same way you would do it in MVC 6 .NET 6 or is there a new way to do it?

AlThePal
Автор

sir this was helpful, i tried to encrypt .config file and works fine, now i tring to use DnSpy i put windowsApplication.exe into Dnspy and return me the actual connection string ? how this is possible ???

joker-qo
Автор

How to decrypt an encrypted file like json? Obb of Android application

godofdestructiondhanasekha
Автор

it does not run when the code is deployed to the server.. works only in the local machine

Jeshhafterhours
Автор

Great! but I'm worried about the code if someone run on his/her computer, they can easily decrypt the connection strings in app.config file. My deployed application is on network drive and I'm using DbConnection Class instead of Configuration Manager. (for safety reasons)

KhalidAfridi
Автор

I have a question, can anyone decrypt the connection string that was encrypted?

jeremykings
Автор

lol we just got hacked our config is not encrypted haha thanks let me try this sir

edgewrld