. NET encryption configuration file connectionstrings node

Source: Internet
Author: User
Tags connectionstrings

Specific can refer to the PetShop source code program.

Before encryption:

<connectionStrings> <add name="sqlprofileconnstring"connectionstring="server= (local); user id=mspetshop; [Email protected];d atabase=mspetshop4profile;min pool Size=4;max pool Size=4;packet size=3072"ProviderName="System.Data.SqlClient"/> <add name="sqlmembershipconnstring"connectionstring="server= (local); user id=mspetshop; [Email protected];d atabase=mspetshop4services;min pool Size=4;max pool Size=4;packet size=3072"ProviderName="System.Data.SqlClient"/> <add name="SQLConnString1"connectionstring="server= (local); user id=mspetshop; [Email protected];d atabase=mspetshop4;min pool Size=4;max pool Size=4;packet size=3072"ProviderName="System.Data.SqlClient"/> <add name="SQLConnString2"connectionstring="server= (local); user id=mspetshop; [Email protected];d atabase=mspetshop4;min pool Size=4;max pool Size=4;packet size=1024"ProviderName="System.Data.SqlClient"/> <add name="SQLConnString3"connectionstring="server= (local); user id=mspetshop; [Email protected];d atabase=mspetshop4orders;min pool Size=4;max pool Size=4;packet size=1024"ProviderName="System.Data.SqlClient"/> <add name="oraprofileconnstring"connectionstring="Data Source=localhost;user Id=mspetshopprofile; [Email protected];min pool Size=4;max Pool size=4"ProviderName="System.Data.OracleClient"/> <add name="oramembershipconnstring"connectionstring="Data Source=localhost;user id=mspetshopmembership; [Email protected];min pool Size=4;max Pool size=4"ProviderName="System.Data.OracleClient"/> <add name="OraConnString1"connectionstring="Data Source=localhost;user Id=mspetshop; [Email protected];min pool Size=4;max Pool size=4"ProviderName="System.Data.OracleClient"/> <add name="OraConnString2"connectionstring="Data Source=localhost;user Id=mspetshop; [Email protected];min pool Size=4;max Pool size=4"ProviderName="System.Data.OracleClient"/> <add name="OraConnString3"connectionstring="Data Source=localhost;user id=mspetshoporders; [Email protected];min pool Size=4;max Pool size=4"ProviderName="System.Data.OracleClient"/> </connectionStrings>
View Code

After encryption:

<connectionstrings configprotectionprovider="RsaProtectedConfigurationProvider"> <encrypteddata type="http://www.w3.org/2001/04/xmlenc#Element"xmlns="http://www.w3.org/2001/04/xmlenc#"> <encryptionmethod algorithm="HTTP://WWW.W3.ORG/2001/04/XMLENC#TRIPLEDES-CBC"/> <keyinfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <encryptedkey xmlns="http://www.w3.org/2001/04/xmlenc#"> <encryptionmethod algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> <keyinfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <keyname>rsa key</keyname> </KeyInfo> <CipherData> &L T ciphervalue>toblojmjmz/3syjaltdhqa/rfrsawf633228vbzg0zuetq2jsjksoxqid0gvozh3aqbfbivoxdg0kspglpt3a+ Xi5kgvwwyurrnqt0cpbcvwobrtqloc5ni87hbqdfaxstrs9xx2kipec91qe1la+l7kk9e48yajxpw82znzgum=</ciphervalue> < /cipherdata> </EncryptedKey> </KeyInfo> <CipherData> <ciphervalue>yfour Cd3mh3tsgquiezf6sfai2rzklxydrx58m0jdgktnk1hpwitsbcpbqioyhu251okh38ki0ibune1vmr6vbqgemnzyzji77zbkjwg6wnjw84ul2tuym0uqodpua bc+7v4vktzrvmq6og3gshqsg8xeqqcz+ R5fs8xfndlvhxel1pmexiyuamc4gple8rdnvngyqwrsaxuphu00zgmqxud6zcunk2ribyb7xvhm5jzx42u4a1gyg581hqwfcpdl2hp2+grffkt +djc23o0ceary02bjj0z0wx1cn2tix/wk1vfqkgxe0/s9sd8rg+eodpaxlwyg3qwhla/lgikgsvcevclpx+n+p1i/ ryvoeanlnaca8tvqazxwgdabdc+tl6xdvikmwgujntnmem1+c5xqeo4v+imqywsmyuqqugrmwqqeye9klvfgxdto+ Fizmrx1ivenckykoe3szhhw0bmlubvpxw64cq/zlada/nigceoaka/xjku7adwkr2pnainblzxnjbxuptqgtbozvq3ybnqymy48uwoo/t3/rhqfw7p3dkiyutazxbxq4zcko2qf/25owjgsiqpxcxf6xkjsknn8fzgyssyy2snstslqppykrrb8oeeq5yxz+ fdahkeseowrof+qmzh177rd7y0dj4nxbaund0aiqmlfw4lmsy3h71d8vxfqnm5gijqnqsjs6gakvjvqfnueaul9hr3fov/ cfdz4nmtico5az2oizy32w9bzo0qeqjt/fvbu0c93yp6wtt/poiq6gm2p8pltpa85dxdmwcvy+ultzrqnr2oo/rjb4tns569dbpba/wugig3s/ 8v68ddjrq+qrtjuxgft/syvlztdhr5ts/rttsd+u1socm6tg53xlbvtlup+mvrpstgbbpvkitq3bub7vaht+rrbwfabd+ isrhb6mhcxf2xuoauleh8ssnet7se89wwoozoh3kioeqdgvy1btn/9ymbif1p+ gohdht8ksmq4bneqbo76gowyu4dmbnhtcyscwv2yhli8c4jc5x1j9w/2nsocgi5hde1tssd6su5g7+ pxokxzwyiobfjekyjdj1cksqggjqqvppfgjo+krar7zwanxrptlpj6qe+4760rhv8g9wzphzepfzhx3a2h83p+ erxq6gvoxlkaptp233iohyaml/ V5knmyzrhctnxaaufufcdxej38hwyf69cy4zx1qs5jleeqegslrqrwokiloxeuleycdw4suoop4te9bpnzsex6h3cfyuqaosuiitzevzm1up1eakqxtq /re78v2euk2ieu7pdzdtv2gbobmozlfxxzxvpc9fxby71z15nlk+9a7ds6kc255b9wr/u1tcbytb+kljonka4c7e8qskjhqm3momj58om8x8a/ v9dmwq9pk0fy6jvmfcxbpctmna5axfx1yutty07x1mh1rbzuvxacsvy7dexrkxto2ludyldvqgzocrjgkisqiliqqffgv1l+q1zufhhzba/ Wnfetogbpwgz3abgahhx7fgmfbouzwnp8xt3x/ryyh6bakngtd+vdusl+jwpyp2ycccsw6wy38umiz4kl+ r681qseau4uywydfmvikajaer4nq8duubt5in562jeabqphrrlyq2bgu+ di0z4qwiwsveodoin6c5wkxksqis2ol9lpx1i06zd2btfakub42u2x9iq3mdz9wwwzmaghelfxvz7npo8qytvr81qt1zj9luabzqm/ cwchduleqvxteo/gc48dphx9pebbgp8hdimqv29+z6q2rm1tkpezybceiemnzd1ghctjce72r8ht1xrnrn+phzmrc6aisz/ Rhih4zamkgbeh90ladu5gnd+oabn7goweasne4r1ycdacchywvalcynhilp8vtmj9lu1jjgh6y3ma/adz2n7kzdwzmsti2wh5/pj+hpyc5qwxh +ek1yzroknt9oruayluowxfsqkzcu5vnzsp74xkwc5kju2d+vk9qy/mtelyvss2jfwno+g3g/kemao2q0ad82znsws4alr2y+ oklxdwd20zckowt2ocjrx6suyenaly4tziuhslp7mjm3cxgulwb2m2mf09xgdvnarbodxpph6u4pq0wegqxxdbhuptf0r1huvqazqh4ito/f/ kudztbjtaommdsu8jma3anieiixteaqqzsifbrqd/scgneacb+y4xesrria/cia5sxl7ilo16s5l8qvciqixbw2vfletz8bsvtyj+/ v8qbtike4gd4yfeushzi+e7kjuikaxmjaioq6rwr7g7+sewg3jmhjmh1cij75f6vgqlovod4ojwak12w6mlh86bp+ rljx4away8e9mmfhu5c8ebj4pehp3rpfk0whkwfxmdlafh9vexxonh6v7bez913x3gwn8sg4lt1eyihfqht3j5epntyft5x+ Xvmrpf993lofmip76oehn6rshd2dq91z7ovobgvvpuf2ala9k6hlak07hrvxjj3mzexzfux8vbnqzfytikx/zf0vyv3woiavpesadvbhg39jmjlfu2minjpcmypsk6yyt5mwxapppfx0bg0+llg5l3dz+sbwgowprtjjh3twd3kelo/ Du9dwkzlpfwume3rsojws2vgtbz2jn7gfqoipoodoowvcznukzbzua4mb5qgh2y7jst2st/x0+by+shakavxuz0woct1qfcvrq1lipmpiohryj +xw+qvqqkdsdsizje/zxda25ihuo0tejhaoajw8fyecdecphcsgptciztpsmhuks1bc9qykqg6vpgz6c+c8=</ciphervalue> </ Cipherdata> </EncryptedData> </connectionStrings>
View Code

Encryptwebconfig.bat Encrypt Batch code:

@echo Offc:\windows\microsoft.net\framework\v2. 0.50727 " connectionStrings " " D:\Program files\microsoft\.net Pet shop 4.0\web " PAUSE
View Code

Decryptwebconfig.bat Decryption Batch code:

@echo Offc:\windows\microsoft.net\framework\v2. 0.50727 " connectionStrings " " D:\Program files\microsoft\.net Pet shop 4.0\web " PAUSE
View Code

. NET encryption configuration file connectionstrings node

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.