加密或隐藏存储的密码 [英] encrypting or hiding stored password

查看:82
本文介绍了加密或隐藏存储的密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在使用vba(msAccess)作为前端时隐藏存储在SQL Server中的密码。

我使用SQL Server 2008存储我的表,应用程序(表单和报告)由msaccess中的vba组成。我想在sqlserver中隐藏或加密存储的密码,以使我的应用程序更安全,即使黑客进入我的sql数据库,仍然无法查看真实密码,而是查看加密密码。任何人都可以帮我这个吗? thanx提前

how to hide password stored in SQL server while using vba (msAccess) as a front end.
Iam using SQL server 2008 to store my tables and the application (forms and reports) are made of vba in msaccess. i want to hide or encrypt stored passwords in sqlserver to make my app more secured, that is even if a hacker gets to my sql database, still won't be able to see the real passwords, instead view encrypted passwords. can any one please help me with this? thanx in advance

推荐答案

您可以使用证书加密和解密。看看这篇文章 SQL - server-introduction-to-encryption [ ^ ]
You can use certificate to encrypt and decrypt. Look at this article SQL - server-introduction-to-encryption[^]


格里夫的好指南:密码存储:怎么做 [< a href =http://www.codeproject.com/Tips/186585/Password-Storage-How-to-do-ittarget =_ blanktitle =New Window> ^ ]。
The Griff's nice guide: "Password Storage: How to do it"[^].


用于加密密码字段

---------------------------- --------

CREATE PROCEDURE SP_InsertUser123

- 在这里添加存储过程的参数



@UName varchar(50),

@Password varchar(50),

@Email varchar(50),

@Phone varchar(50)



AS

BEGIN





- 添加SET NOCOUNT ON以防止额外的结果集

- 干扰SELECT声明。

SET NOCOUNT ON;



- 在此处插入程序声明

插入tbl_User值( @ UName,EncryptByPassPhrase('12',@ Password),@ Email,@ Phone)

END

GO

----- -----------------------

解密密码



For Encrypt Password Fields
------------------------------------
CREATE PROCEDURE SP_InsertUser123
-- Add the parameters for the stored procedure here
(
@UName varchar(50),
@Password varchar(50),
@Email varchar(50),
@Phone varchar(50)
)
AS
BEGIN


-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
insert into tbl_User values(@UName,EncryptByPassPhrase('12',@Password),@Email,@Phone)
END
GO
----------------------------
For decrypt Password

create PROCEDURE SP_Display_User
()
AS
BEGIN


    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    -- Insert statements for procedure here
select UserId,UName, convert(varchar(10), DECRYPTBYPASSPHRASE ('12',password)) as Password from tbl_User
END
GO


这篇关于加密或隐藏存储的密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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