Encrypting connection string in classic asp

霸气de小男生 提交于 2019-12-06 10:27:43

问题


Is it possible to store encrypted connection string so it can be used from server-side vbscript? Was there an equivalent of web.config in 'the good old days'?


回答1:


As I dust off the ol' memory banks...

I recall that in classic ASP systems, we would put the connection string (and most other config settings) in the Windows registry, in a custom registry key for the web app. We'd use a COM DLL to read the settings.

You can encrypt the connection string that is stored in the registry, but you will have to roll your own encryption/decryption.

So the answer is yes, it is definitely possible, but there is no easy tooling built into the framework to encrypt/decrypt on the fly, you have to do it yourself.




回答2:


.Net has all the encryption and decryption code built in so the easiest way to encrypt the string is to use the .Net encryption/decryption functions. Create a .Net component that does the decription and a COM callable wrapper for it which should register it. Then call it from your ASP page.



来源:https://stackoverflow.com/questions/337663/encrypting-connection-string-in-classic-asp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!