如何使用位或二进制类型数据在SQL Server中保存PASSWORD [英] How to save PASSWORD in SQL Server with bit or binary type data

查看:101
本文介绍了如何使用位或二进制类型数据在SQL Server中保存PASSWORD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我开发了一个应用程序,我正在使用SQL Server 2000开发人员版。

我创建了我的数据库,我还创建了tbl_USER表。


我有一个ID,RealName,UserName和UserPassword字段。


我想使用位或二进制数据保存UserName和UserPassword输入

VB.NET。然后当然我必须回顾它们以便稍后进行比较,如果我找到匹配,那么用户可以进入MAIN论坛。


但我不是知道如何用bit或

二进制类型数据保存UserName和UserPassword。这是使用位或二进制数据类型存储UserName和UserPassword

的最佳方法还是我应该找到更好的方法?


4个管理员的主要问题如果我使用nchar数据类型,可以进入sqlServer并读取

userName和UserPassword。


此时加密方法似乎有点困难。我可以存储图像

并使用SQL Server检索它们但我不知道如何用二进制数据类型保存

密码。


有谁知道怎么做?


谢谢。


Rgds,

GC

Hi,

I developed an application and I am using SQL Server 2000 developer edition.
I create my database and I have also created tbl_USER table.

I have an ID, RealName, UserName, and UserPassword fields.

I want to save UserName and UserPassword using bit or binary data type with
VB.NET. Then ofcourse I have to retrive them to compare it later and if I
find match than user can enter the MAIN forum.

But I don''t know how to save the UserName and UserPassword with bit or
binary type data. Is this best way to store the UserName and UserPassword
using bit or binary data type or should I find better way?

My major problem that 4 admin people can enter the sqlServer and read the
userName and UserPassword if I use nchar data type.

The encrypt method seems bit difficult at this moment. I can store images
and retrive them with SQL Server but I don''t know how to achive saving the
password with binary data type.

Does anyone knows how to do it?

Thank you.

Rgds,
GC

推荐答案

您可能想尝试创建MD5哈希,然后以ascii / hex

格式存储它。


然后你创建一个用户输入数据的哈希值进行比较。


戴夫


"孜" <镍**** @ discussions.microsoft.com>在消息中写道

新闻:9D ********************************** @ microsof t.com ...
You might want to try creating an MD5 hash and then storing it in ascii/hex
format.

You then create a hash of the user input data for comparison.

Dave

"Niyazi" <Ni****@discussions.microsoft.com> wrote in message
news:9D**********************************@microsof t.com...


我开发了一个应用程序,我正在使用SQL Server 2000开发人员
版。
我创建了我的数据库我还创建了tbl_USER表。

我有一个ID,RealName,UserName和UserPassword字段。

我想使用位或二进制数据类型保存UserName和UserPassword
用VB.NET。那么当然我必须回顾它们以便稍后进行比较,如果我找到匹配,那么用户可以进入MAIN论坛。

但我不知道如何保存UserName和UserPassword带位或
二进制类型数据。这是使用位或二进制数据类型存储UserName和UserPassword的最佳方法,还是应该找到更好的方法?

我的主要问题是4个管理员可以进入sqlServer并阅读<如果我使用nchar数据类型,则使用userName和UserPassword。

此时加密方法似乎有点困难。我可以存储图像
并使用SQL Server检索它们但我不知道如何用二进制数据类型保存
密码。

有谁知道怎么做它?

谢谢。

Rgds,
GC
Hi,

I developed an application and I am using SQL Server 2000 developer
edition.
I create my database and I have also created tbl_USER table.

I have an ID, RealName, UserName, and UserPassword fields.

I want to save UserName and UserPassword using bit or binary data type
with
VB.NET. Then ofcourse I have to retrive them to compare it later and if I
find match than user can enter the MAIN forum.

But I don''t know how to save the UserName and UserPassword with bit or
binary type data. Is this best way to store the UserName and UserPassword
using bit or binary data type or should I find better way?

My major problem that 4 admin people can enter the sqlServer and read the
userName and UserPassword if I use nchar data type.

The encrypt method seems bit difficult at this moment. I can store images
and retrive them with SQL Server but I don''t know how to achive saving the
password with binary data type.

Does anyone knows how to do it?

Thank you.

Rgds,
GC



对不起应该是Digest,而不是Hash。


Dave
Sorry that should have been Digest, not Hash.

Dave


嗨大卫,


感谢您的回复。我知道告诉你我怎样才能告诉你如何使用MD5从SQL Server中获取信息以及如何将新用户存储为用户名和/或
帐户信息作为UserName和使用MD5的UserPassword。


你知道我在哪里可以找到MD5的好例子。


我在SQL Server中创建了UserName和UserPassword表调用tblUSER和

他们的数据是nchar。我将数据类型改为二进制。


所以现在我可以使用MD5登录,但我不知道该怎么做。你知道如何获得一个链接来显示MD5存储和重新获取数据的好例子吗?
进入SQL Server?


谢谢。


Rgds,

GC


" David Farr" <新闻"。.AT"写道:
Hi David,

Thank you for your reply. I know it wasn''t good idea to tell you how can I
retrive information from SQL Server using MD5 and how to store it new user
account information as UserName and UserPassword using MD5.

Do you know where I can find a good example for MD5.

I created the UserName and UserPassword in SQL Server table call tblUSER and
their data was nchar. And I cahnge the data type to binary.

So now I can log in using MD5 but I don''t know how to do it. Do you know how
to get a link for showing good example of the MD5 storing and retriving data
into SQL Server?

Thank you.

Rgds,
GC

"David Farr" <news".at." wrote:
对不起应该是Digest,而不是Hash。

Dave
Sorry that should have been Digest, not Hash.

Dave



这篇关于如何使用位或二进制类型数据在SQL Server中保存PASSWORD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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