如何加密.net应用程序中的数据并使用AES在sql server中解密它 [英] How to encrypt data in .net apps and decrypt it in sql server using AES

查看:61
本文介绍了如何加密.net应用程序中的数据并使用AES在sql server中解密它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,此时我有一个应用程序使用在SQL SERVER上创建的函数加密某些值,并且此函数将加密值返回给用户,当用户点击某个按钮时我需要解密加密值使用SQL SERVER函数,但我不知道该怎么做,任何建议

解决方案

只有一个问题:为什么在地球上?这有什么用?为什么要做两个回合?在Web应用程序中绝对没有使用对称加密的伪装值。使用https并加密流量,或者忘掉它。为什么?因为你还要发送密钥。在那时,整个加密是无用的。

另一方面,如果你将加密数据发送到客户端,而不是将它发送到服务器只是为了解密它,并将其发送回未加密的...好吧,我不喜欢关于这种情况做出任何陈述。



但我们假设一秒钟,由于某种原因,这个obscrubtion(因为它不是加密,只是因为你使用加密功能)很有用。你写道,在服务器端,sql server正在用AES加密数据(我永远不会在数据存储层中放置这样的功能),你通过asp.net应用程序将这个chipertext发送到客户端。比你有一个浏览器的客户端,你也有javascript。那你为什么不用javascript解密? AES只是AES。只需使用它,例如: https://code.google.com/p/crypto-js/ [ ^ ]


我的建议:

在C#中加密和解密,而不是在SQL Server中。

使用类似的东西:

C# AES 256位带盐的加密库 [ ^ ]


在这里搜索..



https://www.google.co.in/search?q=encry 23 +使用ption +在+ asp.net + C%+ AES&安培; OQ =加密+ +在+ asp.net C%23 + +使用AES&安培; gs_l = serp.3 ... 264136.271321.0.277209.15.14.0.0。 0.1.210.1527.0j8j2.10.0.msedr ... 0 ... 1c.1.58.serp..8.7.1055.MbQ1xtgujJU [ ^ ]



见这里..

http://www.aspsnippets.com/Articles/AES-Encryption-Decryption-Cryptography-Tutorial-with-example -in-ASPNet-using-C-and-VBNet.aspx [ ^ ]

Hi everyone, At this moment I have an application that encrypts some value using a function created on SQL SERVER and this function returns the encrypted value to the user, when the user made click on some button I need to decrypt the encrypted value using a SQL SERVER function, but I dont know how to do that, any recommendations

解决方案

Just one quesrtion: why on Earth? What's this good for? Why doing two roundrips for nothing? There is absolutely no use enctrypting values with symmetric encryption in a web application. Use https and encrypt the traffic, or forget it. Why? Because you neet to send the key also. And at that point the whole encryption is useless.
On the other hand, if you send encrypted data to the client, than you send it beack to the server just to decrypt it, and to send it back unencrypted... well, I prefere not to make any statement about this scenario.

But let's suppose for a second, that for some reason this obscrubtion (as it is not cryptography, just because you use a cryptographic function) is useful. You wrote, that on server side the sql server is encrypting the data with AES (I would never put such a functionality in the datastore tier), and you send this chipertext to the client via an asp.net application. Than you have have a client with a browser where you have javascript also. So why don't you decrypt in javascript? AES is just AES. Just use this for example: https://code.google.com/p/crypto-js/[^]


My recommendation:
Encrypt and decrypt it in C#, not in SQL Server.
Using something like this:
C# AES 256 bits Encryption Library with Salt[^]


Search here..

https://www.google.co.in/search?q=encryption+in+asp.net+c%23+using+aes&oq=encryption+in+asp.net+c%23+using+aes&gs_l=serp.3...264136.271321.0.277209.15.14.0.0.0.1.210.1527.0j8j2.10.0.msedr...0...1c.1.58.serp..8.7.1055.MbQ1xtgujJU[^]

See Here..
http://www.aspsnippets.com/Articles/AES-Encryption-Decryption-Cryptography-Tutorial-with-example-in-ASPNet-using-C-and-VBNet.aspx[^]


这篇关于如何加密.net应用程序中的数据并使用AES在sql server中解密它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆