Author

Portrait of Joannes Vermorel

I am Joannes Vermorel, founder at Lokad. I am also an engineer from the Corps des Mines who initially graduated from the ENS.

I have been passionate about computer science, software matters and data mining for almost two decades. (RSS - ATOM)

Meta
Tags
« Tracking file downloads in Google Analytics AND Google Adwords | Main | Velib's from a software engineer viewpoint »
Wednesday
Oct312007

Crypt your config files with PowerShell 

ASP.Net 2.0 comes with a convenient native support for configuration file encryption. Yet, things are still not that easy for WinForms, Console applications or Windows Services since the aspnet_regiis.exe utility only supports Web Configuration files.

My own μISV has its share of distributed applications which involve securing a few connection strings over several machines. Securing the connection strings through encryption is not an ultimate defense (if the attacker gains executions rights on the local machine, connection strings will get disclosed anyway), but it can still save you a lot of trouble such as involuntary disclosure.

Download crypt-config.zip

I have found a practical way to solve the issue through PowerShell (see the PowerShell team blog for regular tips), namely two functions crypt-config and decrypt-config. The source code comes as single PSH script contains the function definitions.

To get started, extract the PS1 file from the Zip archive, then

PS docs:\> . ($directory + "\crypt-config.ps1") ;

PS docs:\>crypt-config 'MyConsole.exe' 'section';

PS docs:\>decrypt-config 'MyConsole.exe' 'section';

Typically, section will be replaced by connectionStrings. Note that you do not need to add the .config at the end of the configuration file path.

References (1)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Response: All satellite tv
    Hello everyone. This is a truly fantastic site, which I stumbled upon through google, I must say it has been a pleasure viewing this site and I am very happy that I found it, excellent content, keep up the good work and good luck. Help me! I can not find sites ...

Reader Comments (36)

Notes: if you are just interested in password encryption within PowerShell, just have a look at
http://abhishek225.spaces.live.com/Blog/cns!13469C7B7CE6E911!273.entry

November 1, 2007 | Unregistered Commenterjoannes

Очень интересные мнения. Придержусь большинства, так как они более адекватны

October 9, 2009 | Unregistered CommenterGvozdey

интересная статья , но помойму я её видел уже вот http://4full.ru/" rel="nofollow">здесь http://4full.ru/
http://4full.ru" rel="nofollow">

October 10, 2009 | Unregistered Commentergardonchik

Однозначно, уверен, что многие не правы в своих репликах

October 10, 2009 | Unregistered CommenterFrecos

Несовсем понял что написали, можно сдесь и не писать об этом.

October 10, 2009 | Unregistered CommenterSerzhik

Ознакомился, достаточно интересно. Думаю стоит добавить в избранное

October 10, 2009 | Unregistered CommenterRuuuinfo

Доброго времени суток. ТС, Ваш пост весьма интересен. Я думаю в комментах писать свою мыслю не буду. Пишите в аську

October 11, 2009 | Unregistered Commentermoscowserg

А можно подробней немного, а то так и не пойму в чем дело.

October 12, 2009 | Unregistered CommenterZitrex

Я конечно, прошу прощения, но этот ответ мне не подходит. Кто еще, что может подсказать?

http://www.lk009.info

October 12, 2009 | Unregistered CommenteritereeCoime

Как всегда, сколько людей, столько мнений. Давайте попробуем прийти к общему решению!?

October 13, 2009 | Unregistered CommenterKvartirar

так держать

October 13, 2009 | Unregistered Commenteruneseenib

браузерная онлайновая игра - стратегия + социальная сеть.
успевай - http://3apycb.ru/

October 13, 2009 | Unregistered CommenterGameszoo

Постоянно слежу за комментариями в этом блоги. Появляются очень интересные мнения и это радует

October 13, 2009 | Unregistered CommenterNeaktivnih

Хоть бы кто нибудь что то умное написал, все однотипно как то.

October 14, 2009 | Unregistered CommenterPetrik

тс, ты адекватен?

October 14, 2009 | Unregistered CommenterPsihovozik

щя стукну

October 14, 2009 | Unregistered CommenterKimeoptiohilt

хазяинамэ хороишийа постами тэээ

October 15, 2009 | Unregistered CommenterverCissinee

Слава Богу что за это не придумали штрафы выписывать

October 15, 2009 | Unregistered CommenterDraireAtterne

статья хрень полная..

October 15, 2009 | Unregistered Commenterprecinfilipov

вот ведь лажа

October 15, 2009 | Unregistered Commenterallianceblaa

Очень привлекательная новость, думаю стоит добавить в избранное для дальнейшего изучения

October 16, 2009 | Unregistered CommenterVsegame

Ай маладэц!! Как карашо сказал! Я запомну.

October 16, 2009 | Unregistered CommenterHerceJare

Мне,нет надобности

October 16, 2009 | Unregistered CommenterAssigesus

ошибаешься,это не совместимо

October 17, 2009 | Unregistered CommenterABABEEMIDLY

Прочитал, внимательно. Много интересного. Суть ясна.

October 17, 2009 | Unregistered CommenterFirtomirc

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>